[#btck-Iterator]
= xref:btck.adoc[btck]::Iterator
:relfileprefix: ../
:mrdocs:

Random&hyphen;access iterator that lazily materializes views of a collection by index&period;

== Synopsis

Declared in `&lt;kernel&sol;bitcoinkernel&lowbar;wrapper&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename Collection,
    typename ValueType,
    auto GetFunc&gt;
class Iterator;
----

== Description

Dereferencing invokes `GetFunc` on the collection with the current index, returning a copy (a lightweight view), so the iterator does not hold elements&period;

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:btck/Iterator/difference_type.adoc[`difference&lowbar;type`] 
| Signed distance between iterators&period;
| xref:btck/Iterator/iterator_category.adoc[`iterator&lowbar;category`] 
| Iterator category tag&period;
| xref:btck/Iterator/iterator_concept.adoc[`iterator&lowbar;concept`] 
| Iterator concept tag&period;
| xref:btck/Iterator/value_type.adoc[`value&lowbar;type`] 
| The element type produced on dereference&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:btck/Iterator/2constructor-0dc.adoc[`Iterator`]         [.small]#[constructor]#
| Constructors
| xref:btck/Iterator/operator_star.adoc[`operator&ast;`] 
| Returns the element at the current index&period;
| xref:btck/Iterator/operator_plus.adoc[`operator&plus;`] 
| Returns an iterator advanced by `n` positions&period;
| xref:btck/Iterator/operator_inc-01c.adoc[`operator&plus;&plus;`] 
| Increment operators
| xref:btck/Iterator/operator_plus_eq.adoc[`operator&plus;&equals;`] 
| Advances the iterator by `n` positions&period;
| xref:btck/Iterator/operator_minus-03.adoc[`operator&hyphen;`] 
| Subtraction operators
| xref:btck/Iterator/operator_dec-02.adoc[`operator&hyphen;&hyphen;`] 
| Decrement operators
| xref:btck/Iterator/operator_minus_eq.adoc[`operator&hyphen;&equals;`] 
| Rewinds the iterator by `n` positions&period;
| xref:btck/Iterator/operator_subs.adoc[`operator&lsqb;&rsqb;`] 
| Returns the element `n` positions from the current one&period;
| xref:btck/Iterator/operator_eq.adoc[`operator&equals;&equals;`] 
| Tests two iterators for equality&period;
| xref:btck/Iterator/operator_3way.adoc[`operator&lt;&equals;&gt;`] 
| Orders two iterators by index&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:btck/operator_plus.adoc[btck::operator&plus;]`
| Returns an iterator advanced by `n` positions (offset on the left)&period;
|===


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