is_bidirectional_iterator

Description

A bidirectional iterator is a forward iterator that can be moved in both directions (i.e. incremented and decremented).

Requirements

The type It satisfies is_bidirectional_iterator if

And, given

  • a and b, iterators of type It
  • reference, the type denoted by std::iterator_traits<It>::reference

The following expressions must be valid and have their specified effects

Expression Return Equivalent expression
--a It&  
a-- convertible to It& It temp = a; --a; return temp;
*a-- reference  

Synopsis

TICK_TRAIT(is_bidirectional_iterator, is_forward_iterator<_>)
{
    template<class I>
    auto require(I&& i) -> valid<
        decltype(returns<typename std::add_lvalue_reference<I>::type>(--i)),
        decltype(returns<I>(i--)),
        decltype(returns<typename iterator_traits<I>::reference>(*i--))
    >;
};