[#BloombergLP-bslstl-BidirectionalIterator] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::BidirectionalIterator :relfileprefix: ../../ :mrdocs: Adaptor that produces a standard bidirectional iterator from a core type. == Synopsis Declared in `<bslstl_bidirectionaliterator.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class T, class ITER_IMP, class TAG_TYPE = std::bidirectional_iterator_tag> class BidirectionalIterator : public xref:BloombergLP/bslstl/ForwardIterator.adoc[ForwardIterator<T, ITER_IMP, TAG_TYPE>] ---- == Description Given an `ITER_IMP` type that implements a minimal subset of an iterator interface, this template generates a complete iterator that meets all of the requirements of a "bidirectional iterator" in the C++ standard. If `T` is `const`‐qualified, then the resulting type is a constant iterator. `T` shall not be a function, reference type or void. `ITER_IMP` must provide public operations so that, for objects `i` and `j` of type `ITER_IMP`, the following operations are supported: ` ITER_IMP i; default construction ITER_IMP j(i); copy construction i = j assignment ++i increment to next element ‐‐i decrement to previous element i == j // convertible to bool equality comparison *i // reference convertible to T& element access (dereference) ` == Base Classes [cols="1,4"] |=== | Name| Description | `xref:BloombergLP/bslstl/ForwardIterator.adoc[ForwardIterator<T, ITER_IMP, TAG_TYPE>]` | STL‐compliant forward iterator adapted from a minimal implementation. |=== == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslstl/BidirectionalIterator/difference_type.adoc[`difference_type`] | Type of the distance between two iterators. | xref:BloombergLP/bslstl/BidirectionalIterator/iterator_category.adoc[`iterator_category`] | Standard iterator category tag for bidirectional iterators. | xref:BloombergLP/bslstl/BidirectionalIterator/pointer.adoc[`pointer`] | Pointer type for the iterator's element type. | xref:BloombergLP/bslstl/BidirectionalIterator/reference.adoc[`reference`] | Reference type for the iterator's element type. | xref:BloombergLP/bslstl/BidirectionalIterator/value_type.adoc[`value_type`] | Type of the value obtained when dereferencing the iterator. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslstl/BidirectionalIterator/2constructor-09.adoc[`BidirectionalIterator`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bslstl/BidirectionalIterator/operator_assign-05.adoc[`operator=`] | Assignment operators | xref:BloombergLP/bslstl/ForwardIterator/imp-0e.adoc[`imp`] | `imp` overloads | xref:BloombergLP/bslstl/ForwardIterator/operator_star.adoc[`operator*`] | Return a reference to the current element. | xref:BloombergLP/bslstl/BidirectionalIterator/operator_inc.adoc[`operator++`] | Advance this iterator to the next element. | xref:BloombergLP/bslstl/BidirectionalIterator/operator_dec.adoc[`operator‐‐`] | Regress this iterator to the previous element. | xref:BloombergLP/bslstl/ForwardIterator/operator_ptr.adoc[`operator‐>`] | Return a pointer to the current element. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslstl/operator_not_eq-0bc.adoc[`operator!=`] | Return `true` if `lhs` and `rhs` do not have the same value. | xref:BloombergLP/bslstl/operator_not_eq-0d.adoc[`operator!=`] | Return whether two bidirectional iterators refer to different positions. | xref:BloombergLP/bslstl/operator_inc-008.adoc[`operator++`] | Advance `iter` to the next element and return its previous value. | xref:BloombergLP/bslstl/operator_inc-07.adoc[`operator++`] | Post‐increment the specified iterator and return its previous value. | xref:BloombergLP/bslstl/operator_dec-08.adoc[`operator‐‐`] | Post‐decrement the specified iterator and return its previous value. | xref:BloombergLP/bslstl/operator_eq-066.adoc[`operator==`] | Return `true` if `lhs` and `rhs` have the same value. | xref:BloombergLP/bslstl/operator_eq-08.adoc[`operator==`] | Return whether two bidirectional iterators refer to the same position. |=== == Derived Classes [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslstl/RandomAccessIterator.adoc[`RandomAccessIterator`] | STL‐compliant random‐access iterator adapted from a minimal implementation. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#