[#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&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;bidirectionaliterator&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class T,
    class ITER&lowbar;IMP,
    class TAG&lowbar;TYPE = std::bidirectional&lowbar;iterator&lowbar;tag&gt;
class BidirectionalIterator
    : public xref:BloombergLP/bslstl/ForwardIterator.adoc[ForwardIterator&lt;T, ITER&lowbar;IMP, TAG&lowbar;TYPE&gt;]
----

== Description

Given an `ITER&lowbar;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 &quot;bidirectional iterator&quot; in the C&plus;&plus; standard&period; If `T` is `const`&hyphen;qualified, then the resulting type is a constant iterator&period; `T` shall not be a function, reference type or void&period; `ITER&lowbar;IMP` must provide public operations so that, for objects `i` and `j` of type `ITER&lowbar;IMP`, the following operations are supported&colon; &grave; ITER&lowbar;IMP i&semi; default construction ITER&lowbar;IMP j(i)&semi; copy construction i &equals; j assignment &plus;&plus;i increment to next element &hyphen;&hyphen;i decrement to previous element i &equals;&equals; j &sol;&sol; convertible to bool equality comparison &ast;i &sol;&sol; reference convertible to T&amp; element access (dereference) &grave;

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `xref:BloombergLP/bslstl/ForwardIterator.adoc[ForwardIterator&lt;T, ITER&lowbar;IMP, TAG&lowbar;TYPE&gt;]`
| STL&hyphen;compliant forward iterator adapted from a minimal implementation&period;
|===

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslstl/BidirectionalIterator/difference_type.adoc[`difference&lowbar;type`] 
| Type of the distance between two iterators&period;
| xref:BloombergLP/bslstl/BidirectionalIterator/iterator_category.adoc[`iterator&lowbar;category`] 
| Standard iterator category tag for bidirectional iterators&period;
| xref:BloombergLP/bslstl/BidirectionalIterator/pointer.adoc[`pointer`] 
| Pointer type for the iterator&apos;s element type&period;
| xref:BloombergLP/bslstl/BidirectionalIterator/reference.adoc[`reference`] 
| Reference type for the iterator&apos;s element type&period;
| xref:BloombergLP/bslstl/BidirectionalIterator/value_type.adoc[`value&lowbar;type`] 
| Type of the value obtained when dereferencing the iterator&period;
|===


== 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&equals;`] 
| Assignment operators
| xref:BloombergLP/bslstl/ForwardIterator/imp-0e.adoc[`imp`] 
| `imp` overloads
| xref:BloombergLP/bslstl/ForwardIterator/operator_star.adoc[`operator&ast;`] 
| Return a reference to the current element&period;
| xref:BloombergLP/bslstl/BidirectionalIterator/operator_inc.adoc[`operator&plus;&plus;`] 
| Advance this iterator to the next element&period;
| xref:BloombergLP/bslstl/BidirectionalIterator/operator_dec.adoc[`operator&hyphen;&hyphen;`] 
| Regress this iterator to the previous element&period;
| xref:BloombergLP/bslstl/ForwardIterator/operator_ptr.adoc[`operator&hyphen;&gt;`] 
| Return a pointer to the current element&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslstl/operator_not_eq-0bc.adoc[`operator!&equals;`]
| Return `true` if `lhs` and `rhs` do not have the same value&period;
| xref:BloombergLP/bslstl/operator_not_eq-0d.adoc[`operator!&equals;`]
| Return whether two bidirectional iterators refer to different positions&period;
| xref:BloombergLP/bslstl/operator_inc-008.adoc[`operator&plus;&plus;`]
| Advance `iter` to the next element and return its previous value&period;
| xref:BloombergLP/bslstl/operator_inc-07.adoc[`operator&plus;&plus;`]
| Post&hyphen;increment the specified iterator and return its previous value&period;
| xref:BloombergLP/bslstl/operator_dec-08.adoc[`operator&hyphen;&hyphen;`]
| Post&hyphen;decrement the specified iterator and return its previous value&period;
| xref:BloombergLP/bslstl/operator_eq-066.adoc[`operator&equals;&equals;`]
| Return `true` if `lhs` and `rhs` have the same value&period;
| xref:BloombergLP/bslstl/operator_eq-08.adoc[`operator&equals;&equals;`]
| Return whether two bidirectional iterators refer to the same position&period;
|===

== Derived Classes

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslstl/RandomAccessIterator.adoc[`RandomAccessIterator`] 
| STL&hyphen;compliant random&hyphen;access iterator adapted from a minimal implementation&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
