2007-11-06 12:13:52 +00:00
< html >
< head >
< meta http-equiv = "Content-Type" content = "text/html; charset=ISO-8859-1" >
< title > Iterator Facade< / title >
2007-11-07 03:46:23 +00:00
< link rel = "stylesheet" href = "../../../../../../doc/html/boostbook.css" type = "text/css" >
2009-06-13 06:29:32 +00:00
< meta name = "generator" content = "DocBook XSL Stylesheets V1.65.1" >
< link rel = "home" href = "../../index.html" title = "Chapter<65> 1.<2E> Fusion 2.0" >
2007-11-06 12:13:52 +00:00
< link rel = "up" href = "../extension.html" title = "Extension" >
2009-06-13 06:29:32 +00:00
< link rel = "previous" href = "sequence_facade.html" title = "Sequence Facade" >
2007-12-20 23:28:26 +00:00
< link rel = "next" href = "../functional.html" title = "Functional" >
2007-11-06 12:13:52 +00:00
< / head >
< body bgcolor = "white" text = "black" link = "#0000FF" vlink = "#840084" alink = "#0000FF" >
< table cellpadding = "2" width = "100%" > < tr >
< td valign = "top" > < img alt = "Boost C++ Libraries" width = "277" height = "86" src = "../../../../../../boost.png" > < / td >
2008-07-17 23:59:22 +00:00
< td align = "center" > < a href = "../../../../../../index.html" > Home< / a > < / td >
2007-11-06 12:13:52 +00:00
< td align = "center" > < a href = "../../../../../libraries.htm" > Libraries< / a > < / td >
2008-07-17 23:59:22 +00:00
< td align = "center" > < a href = "http://www.boost.org/users/people.html" > People< / a > < / td >
< td align = "center" > < a href = "http://www.boost.org/users/faq.html" > FAQ< / a > < / td >
2007-11-06 12:13:52 +00:00
< td align = "center" > < a href = "../../../../../../more/index.htm" > More< / a > < / td >
< / tr > < / table >
< hr >
< div class = "spirit-nav" >
2007-12-20 23:28:26 +00:00
< a accesskey = "p" href = "sequence_facade.html" > < img src = "../../../../../../doc/html/images/prev.png" alt = "Prev" > < / a > < a accesskey = "u" href = "../extension.html" > < img src = "../../../../../../doc/html/images/up.png" alt = "Up" > < / a > < a accesskey = "h" href = "../../index.html" > < img src = "../../../../../../doc/html/images/home.png" alt = "Home" > < / a > < a accesskey = "n" href = "../functional.html" > < img src = "../../../../../../doc/html/images/next.png" alt = "Next" > < / a >
2007-11-06 12:13:52 +00:00
< / div >
< div class = "section" lang = "en" >
2009-06-13 06:29:32 +00:00
< div class = "titlepage" >
< div > < div > < h3 class = "title" >
< a name = "fusion.extension.iterator_facade" > < / a > < a href = "iterator_facade.html" title = "Iterator Facade" > Iterator Facade< / a >
< / h3 > < / div > < / div >
< div > < / div >
< / div >
2007-11-06 12:13:52 +00:00
< a name = "fusion.extension.iterator_facade.description" > < / a > < h4 >
2009-06-13 06:29:32 +00:00
< a name = "id605224" > < / a >
2007-11-06 12:13:52 +00:00
< a href = "iterator_facade.html#fusion.extension.iterator_facade.description" > Description< / a >
< / h4 >
< p >
2009-06-13 06:29:32 +00:00
The < a href = "iterator_facade.html" title = "Iterator Facade" > < tt class = "computeroutput" > < span class = "identifier" > iterator_facade< / span > < / tt > < / a >
2007-11-06 12:13:52 +00:00
template provides an intrusive mechanism for producing a conforming Fusion
iterator.
< / p >
< a name = "fusion.extension.iterator_facade.synopsis" > < / a > < h4 >
2009-06-13 06:29:32 +00:00
< a name = "id605272" > < / a >
2007-11-06 12:13:52 +00:00
< a href = "iterator_facade.html#fusion.extension.iterator_facade.synopsis" > Synopsis< / a >
< / h4 >
2009-02-22 06:27:12 +00:00
< pre class = "programlisting" > < span class = "keyword" > template< / span > < span class = "special" > < < / span > < span class = "keyword" > typename< / span > < span class = "identifier" > Derived< / span > < span class = "special" > ,< / span > < span class = "keyword" > typename< / span > < span class = "identifier" > TravesalTag< / span > < span class = "special" > > < / span >
2007-11-06 12:13:52 +00:00
< span class = "keyword" > struct< / span > < span class = "identifier" > iterator_facade< / span > < span class = "special" > ;< / span >
< / pre >
< a name = "fusion.extension.iterator_facade.usage" > < / a > < h4 >
2009-06-13 06:29:32 +00:00
< a name = "id605364" > < / a >
2007-11-06 12:13:52 +00:00
< a href = "iterator_facade.html#fusion.extension.iterator_facade.usage" > Usage< / a >
< / h4 >
< p >
The user of iterator_facade derives his iterator type from a specialization
of iterator_facade and passes the derived iterator type as the first template
parameter. The second template parameter should be the traversal category
of the iterator being implemented.
< / p >
< p >
The user must the implement the key expressions required by their iterator
type.
< / p >
< div class = "table" >
2009-06-13 06:29:32 +00:00
< a name = "id605390" > < / a > < p class = "title" > < b > Table<EFBFBD> 1.93.<2E> Parameters< / b > < / p >
2007-11-06 12:13:52 +00:00
< table class = "table" summary = "Parameters" >
< colgroup >
< col >
< col >
< / colgroup >
< thead > < tr >
2009-06-13 06:29:32 +00:00
< th > < p >
2007-11-06 12:13:52 +00:00
Name
2009-06-13 06:29:32 +00:00
< / p > < / th >
< th > < p >
2007-11-06 12:13:52 +00:00
Description
2009-06-13 06:29:32 +00:00
< / p > < / th >
2007-11-06 12:13:52 +00:00
< / tr > < / thead >
< tbody >
< tr >
2009-06-13 06:29:32 +00:00
< td > < p >
< tt class = "computeroutput" > < span class = "identifier" > iterator< / span > < / tt > , < tt class = "computeroutput" > < span class = "identifier" > It< / span > < / tt > , < tt class = "computeroutput" > < span class = "identifier" > It1< / span > < / tt > ,
< tt class = "computeroutput" > < span class = "identifier" > It2< / span > < / tt >
< / p > < / td >
< td > < p >
A type derived from < a href = "iterator_facade.html" title = "Iterator Facade" > < tt class = "computeroutput" > < span class = "identifier" > iterator_facade< / span > < / tt > < / a >
< / p > < / td >
2007-11-06 12:13:52 +00:00
< / tr >
< tr >
2009-06-13 06:29:32 +00:00
< td > < p >
< tt class = "computeroutput" > < span class = "identifier" > N< / span > < / tt >
< / p > < / td >
< td > < p >
2007-11-06 12:13:52 +00:00
An < a href = "http://www.boost.org/libs/mpl/doc/refmanual/integral-constant.html" target = "_top" > MPL
Integral Constant< / a >
2009-06-13 06:29:32 +00:00
< / p > < / td >
2007-11-06 12:13:52 +00:00
< / tr >
< / tbody >
< / table >
< / div >
< div class = "table" >
2009-06-13 06:29:32 +00:00
< a name = "id605548" > < / a > < p class = "title" > < b > Table<EFBFBD> 1.94.<2E> Key Expressions< / b > < / p >
2007-11-06 12:13:52 +00:00
< table class = "table" summary = "Key Expressions" >
< colgroup >
< col >
< col >
< col >
< / colgroup >
< thead > < tr >
2009-06-13 06:29:32 +00:00
< th > < p >
2007-11-06 12:13:52 +00:00
Expression
2009-06-13 06:29:32 +00:00
< / p > < / th >
< th > < p >
2007-11-06 12:13:52 +00:00
Result
2009-06-13 06:29:32 +00:00
< / p > < / th >
< th > < p >
2007-11-06 12:13:52 +00:00
Default
2009-06-13 06:29:32 +00:00
< / p > < / th >
2007-11-06 12:13:52 +00:00
< / tr > < / thead >
< tbody >
< tr >
2009-06-13 06:29:32 +00:00
< td > < p >
< tt class = "computeroutput" > < span class = "identifier" > iterator< / span > < span class = "special" > ::< / span > < span class = "keyword" > template< / span > < span class = "identifier" > value_of< / span > < span class = "special" > < < / span > < span class = "identifier" > It< / span > < span class = "special" > > ::< / span > < span class = "identifier" > type< / span > < / tt >
< / p > < / td >
< td > < p >
The element stored at iterator position < tt class = "computeroutput" > < span class = "identifier" > It< / span > < / tt >
< / p > < / td >
< td > < p >
2007-11-06 12:13:52 +00:00
None
2009-06-13 06:29:32 +00:00
< / p > < / td >
2007-11-06 12:13:52 +00:00
< / tr >
< tr >
2009-06-13 06:29:32 +00:00
< td > < p >
< tt class = "computeroutput" > < span class = "identifier" > iterator< / span > < span class = "special" > ::< / span > < span class = "keyword" > template< / span > < span class = "identifier" > deref< / span > < span class = "special" > < < / span > < span class = "identifier" > It< / span > < span class = "special" > > ::< / span > < span class = "identifier" > type< / span > < / tt >
< / p > < / td >
< td > < p >
The type returned when dereferencing an iterator of type < tt class = "computeroutput" > < span class = "identifier" > It< / span > < / tt >
< / p > < / td >
< td > < p >
2007-11-06 12:13:52 +00:00
None
2009-06-13 06:29:32 +00:00
< / p > < / td >
2007-11-06 12:13:52 +00:00
< / tr >
< tr >
2009-06-13 06:29:32 +00:00
< td > < p >
< tt class = "computeroutput" > < span class = "identifier" > iterator< / span > < span class = "special" > ::< / span > < span class = "keyword" > template< / span > < span class = "identifier" > deref< / span > < span class = "special" > < < / span > < span class = "identifier" > It< / span > < span class = "special" > > ::< / span > < span class = "identifier" > call< / span > < span class = "special" > (< / span > < span class = "identifier" > it< / span > < span class = "special" > )< / span > < / tt >
< / p > < / td >
< td > < p >
Dereferences iterator < tt class = "computeroutput" > < span class = "identifier" > it< / span > < / tt >
< / p > < / td >
< td > < p >
2007-11-06 12:13:52 +00:00
None
2009-06-13 06:29:32 +00:00
< / p > < / td >
2007-11-06 12:13:52 +00:00
< / tr >
< tr >
2009-06-13 06:29:32 +00:00
< td > < p >
< tt class = "computeroutput" > < span class = "identifier" > iterator< / span > < span class = "special" > ::< / span > < span class = "keyword" > template< / span > < span class = "identifier" > next< / span > < span class = "special" > < < / span > < span class = "identifier" > It< / span > < span class = "special" > > ::< / span > < span class = "identifier" > type< / span > < / tt >
< / p > < / td >
< td > < p >
The type of the next element from < tt class = "computeroutput" > < span class = "identifier" > It< / span > < / tt >
< / p > < / td >
< td > < p >
2007-11-06 12:13:52 +00:00
None
2009-06-13 06:29:32 +00:00
< / p > < / td >
2007-11-06 12:13:52 +00:00
< / tr >
< tr >
2009-06-13 06:29:32 +00:00
< td > < p >
< tt class = "computeroutput" > < span class = "identifier" > iterator< / span > < span class = "special" > ::< / span > < span class = "keyword" > template< / span > < span class = "identifier" > next< / span > < span class = "special" > < < / span > < span class = "identifier" > It< / span > < span class = "special" > > ::< / span > < span class = "identifier" > call< / span > < span class = "special" > (< / span > < span class = "identifier" > it< / span > < span class = "special" > )< / span > < / tt >
< / p > < / td >
< td > < p >
The next iterator after < tt class = "computeroutput" > < span class = "identifier" > it< / span > < / tt >
< / p > < / td >
< td > < p >
2007-11-06 12:13:52 +00:00
None
2009-06-13 06:29:32 +00:00
< / p > < / td >
2007-11-06 12:13:52 +00:00
< / tr >
< tr >
2009-06-13 06:29:32 +00:00
< td > < p >
< tt class = "computeroutput" > < span class = "identifier" > iterator< / span > < span class = "special" > ::< / span > < span class = "keyword" > template< / span > < span class = "identifier" > prior< / span > < span class = "special" > < < / span > < span class = "identifier" > It< / span > < span class = "special" > > ::< / span > < span class = "identifier" > type< / span > < / tt >
< / p > < / td >
< td > < p >
The type of the next element from < tt class = "computeroutput" > < span class = "identifier" > It< / span > < / tt >
< / p > < / td >
< td > < p >
2007-11-06 12:13:52 +00:00
None
2009-06-13 06:29:32 +00:00
< / p > < / td >
2007-11-06 12:13:52 +00:00
< / tr >
< tr >
2009-06-13 06:29:32 +00:00
< td > < p >
< tt class = "computeroutput" > < span class = "identifier" > iterator< / span > < span class = "special" > ::< / span > < span class = "keyword" > template< / span > < span class = "identifier" > prior< / span > < span class = "special" > < < / span > < span class = "identifier" > It< / span > < span class = "special" > > ::< / span > < span class = "identifier" > call< / span > < span class = "special" > (< / span > < span class = "identifier" > it< / span > < span class = "special" > )< / span > < / tt >
< / p > < / td >
< td > < p >
The next iterator after < tt class = "computeroutput" > < span class = "identifier" > it< / span > < / tt >
< / p > < / td >
< td > < p >
2007-11-06 12:13:52 +00:00
None
2009-06-13 06:29:32 +00:00
< / p > < / td >
2007-11-06 12:13:52 +00:00
< / tr >
< tr >
2009-06-13 06:29:32 +00:00
< td > < p >
< tt class = "computeroutput" > < span class = "identifier" > iterator< / span > < span class = "special" > ::< / span > < span class = "keyword" > template< / span > < span class = "identifier" > advance< / span > < span class = "special" > < < / span > < span class = "identifier" > It< / span > < span class = "special" > ,< / span > < span class = "identifier" > N< / span > < span class = "special" > > ::< / span > < span class = "identifier" > type< / span > < / tt >
< / p > < / td >
< td > < p >
The type of an iterator advanced < tt class = "computeroutput" > < span class = "identifier" > N< / span > < / tt >
elements from < tt class = "computeroutput" > < span class = "identifier" > It< / span > < / tt >
< / p > < / td >
< td > < p >
Implemented in terms of < tt class = "computeroutput" > < span class = "identifier" > next< / span > < / tt >
and < tt class = "computeroutput" > < span class = "identifier" > prior< / span > < / tt >
< / p > < / td >
2007-11-06 12:13:52 +00:00
< / tr >
< tr >
2009-06-13 06:29:32 +00:00
< td > < p >
< tt class = "computeroutput" > < span class = "identifier" > iterator< / span > < span class = "special" > ::< / span > < span class = "keyword" > template< / span > < span class = "identifier" > advance< / span > < span class = "special" > < < / span > < span class = "identifier" > It< / span > < span class = "special" > ,< / span > < span class = "identifier" > N< / span > < span class = "special" > > ::< / span > < span class = "identifier" > call< / span > < span class = "special" > (< / span > < span class = "identifier" > it< / span > < span class = "special" > )< / span > < / tt >
< / p > < / td >
< td > < p >
An iterator advanced < tt class = "computeroutput" > < span class = "identifier" > N< / span > < / tt >
elements from < tt class = "computeroutput" > < span class = "identifier" > it< / span > < / tt >
< / p > < / td >
< td > < p >
Implemented in terms of < tt class = "computeroutput" > < span class = "identifier" > next< / span > < / tt >
and < tt class = "computeroutput" > < span class = "identifier" > prior< / span > < / tt >
< / p > < / td >
2007-11-06 12:13:52 +00:00
< / tr >
< tr >
2009-06-13 06:29:32 +00:00
< td > < p >
< tt class = "computeroutput" > < span class = "identifier" > iterator< / span > < span class = "special" > ::< / span > < span class = "keyword" > template< / span > < span class = "identifier" > distance< / span > < span class = "special" > < < / span > < span class = "identifier" > It1< / span > < span class = "special" > ,< / span > < span class = "identifier" > It2< / span > < span class = "special" > > ::< / span > < span class = "identifier" > type< / span > < / tt >
< / p > < / td >
< td > < p >
The distance between iterators of type < tt class = "computeroutput" > < span class = "identifier" > It1< / span > < / tt >
and < tt class = "computeroutput" > < span class = "identifier" > It2< / span > < / tt > as an < a href = "http://www.boost.org/libs/mpl/doc/refmanual/integral-constant.html" target = "_top" > MPL
2007-11-06 12:13:52 +00:00
Integral Constant< / a >
2009-06-13 06:29:32 +00:00
< / p > < / td >
< td > < p >
2007-11-06 12:13:52 +00:00
None
2009-06-13 06:29:32 +00:00
< / p > < / td >
2007-11-06 12:13:52 +00:00
< / tr >
< tr >
2009-06-13 06:29:32 +00:00
< td > < p >
< tt class = "computeroutput" > < span class = "identifier" > iterator< / span > < span class = "special" > ::< / span > < span class = "keyword" > template< / span > < span class = "identifier" > distance< / span > < span class = "special" > < < / span > < span class = "identifier" > It1< / span > < span class = "special" > ,< / span > < span class = "identifier" > It2< / span > < span class = "special" > > ::< / span > < span class = "identifier" > call< / span > < span class = "special" > (< / span > < span class = "identifier" > it1< / span > < span class = "special" > ,< / span > < span class = "identifier" > it2< / span > < span class = "special" > )< / span > < / tt >
< / p > < / td >
< td > < p >
The distance between iterator < tt class = "computeroutput" > < span class = "identifier" > it1< / span > < / tt >
and < tt class = "computeroutput" > < span class = "identifier" > it2< / span > < / tt >
< / p > < / td >
< td > < p >
2007-11-06 12:13:52 +00:00
None
2009-06-13 06:29:32 +00:00
< / p > < / td >
2007-11-06 12:13:52 +00:00
< / tr >
< tr >
2009-06-13 06:29:32 +00:00
< td > < p >
< tt class = "computeroutput" > < span class = "identifier" > iterator< / span > < span class = "special" > ::< / span > < span class = "keyword" > template< / span > < span class = "identifier" > equal_to< / span > < span class = "special" > < < / span > < span class = "identifier" > It1< / span > < span class = "special" > ,< / span > < span class = "identifier" > It2< / span > < span class = "special" > > ::< / span > < span class = "identifier" > type< / span > < / tt >
< / p > < / td >
< td > < p >
The distance between iterators of type < tt class = "computeroutput" > < span class = "identifier" > It1< / span > < / tt >
and < tt class = "computeroutput" > < span class = "identifier" > It2< / span > < / tt >
< / p > < / td >
< td > < p >
< tt class = "computeroutput" > < span class = "identifier" > boost< / span > < span class = "special" > ::< / span > < span class = "identifier" > same_type< / span > < span class = "special" > < < / span > < span class = "identifier" > It1< / span > < span class = "special" > ,< / span > < span class = "identifier" > It2< / span > < span class = "special" > > ::< / span > < span class = "identifier" > type< / span > < / tt >
< / p > < / td >
2007-11-06 12:13:52 +00:00
< / tr >
< tr >
2009-06-13 06:29:32 +00:00
< td > < p >
< tt class = "computeroutput" > < span class = "identifier" > iterator< / span > < span class = "special" > ::< / span > < span class = "keyword" > template< / span > < span class = "identifier" > equal_to< / span > < span class = "special" > < < / span > < span class = "identifier" > It1< / span > < span class = "special" > ,< / span > < span class = "identifier" > It2< / span > < span class = "special" > > ::< / span > < span class = "identifier" > call< / span > < span class = "special" > (< / span > < span class = "identifier" > it1< / span > < span class = "special" > ,< / span > < span class = "identifier" > it2< / span > < span class = "special" > )< / span > < / tt >
< / p > < / td >
< td > < p >
The distance between iterators < tt class = "computeroutput" > < span class = "identifier" > it1< / span > < / tt >
and < tt class = "computeroutput" > < span class = "identifier" > it2< / span > < / tt >
< / p > < / td >
< td > < p >
< tt class = "computeroutput" > < span class = "identifier" > boost< / span > < span class = "special" > ::< / span > < span class = "identifier" > same_type< / span > < span class = "special" > < < / span > < span class = "identifier" > It1< / span > < span class = "special" > ,< / span > < span class = "identifier" > It2< / span > < span class = "special" > > ::< / span > < span class = "identifier" > type< / span > < span class = "special" > ()< / span > < / tt >
< / p > < / td >
2007-11-06 12:13:52 +00:00
< / tr >
< / tbody >
< / table >
< / div >
< a name = "fusion.extension.iterator_facade.header" > < / a > < h4 >
2009-06-13 06:29:32 +00:00
< a name = "id607107" > < / a >
2007-11-06 12:13:52 +00:00
< a href = "iterator_facade.html#fusion.extension.iterator_facade.header" > Header< / a >
< / h4 >
2009-02-22 06:27:12 +00:00
< pre class = "programlisting" > < span class = "preprocessor" > #include< / span > < span class = "special" > < < / span > < span class = "identifier" > boost< / span > < span class = "special" > /< / span > < span class = "identifier" > fusion< / span > < span class = "special" > /< / span > < span class = "identifier" > iterator< / span > < span class = "special" > /< / span > < span class = "identifier" > iterator_facade< / span > < span class = "special" > .< / span > < span class = "identifier" > hpp< / span > < span class = "special" > > < / span >
2007-11-06 12:13:52 +00:00
< span class = "preprocessor" > #include< / span > < span class = "special" > < < / span > < span class = "identifier" > boost< / span > < span class = "special" > /< / span > < span class = "identifier" > fusion< / span > < span class = "special" > /< / span > < span class = "identifier" > include< / span > < span class = "special" > /< / span > < span class = "identifier" > iterator_facade< / span > < span class = "special" > .< / span > < span class = "identifier" > hpp< / span > < span class = "special" > > < / span >
< / pre >
2007-11-07 02:12:28 +00:00
< a name = "fusion.extension.iterator_facade.example" > < / a > < h4 >
2009-06-13 06:29:32 +00:00
< a name = "id607264" > < / a >
2007-11-07 02:12:28 +00:00
< a href = "iterator_facade.html#fusion.extension.iterator_facade.example" > Example< / a >
< / h4 >
< p >
2009-06-13 06:29:32 +00:00
A full working example using < a href = "iterator_facade.html" title = "Iterator Facade" > < tt class = "computeroutput" > < span class = "identifier" > iterator_facade< / span > < / tt > < / a > is provided in triple.cpp
2007-11-07 02:12:28 +00:00
in the extension examples.
< / p >
2007-11-06 12:13:52 +00:00
< / div >
< table xmlns:rev = "http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width = "100%" > < tr >
< td align = "left" > < / td >
2007-11-14 10:17:09 +00:00
< td align = "right" > < div class = "copyright-footer" > Copyright <20> 2001-2007 Joel de Guzman, Dan Marsden, Tobias
2007-11-07 02:12:28 +00:00
Schwinger< p >
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at < a href = "http://www.boost.org/LICENSE_1_0.txt" target = "_top" > http://www.boost.org/LICENSE_1_0.txt< / a > )
2007-11-14 10:17:09 +00:00
< / p >
< / div > < / td >
2007-11-06 12:13:52 +00:00
< / tr > < / table >
< hr >
< div class = "spirit-nav" >
2007-12-20 23:28:26 +00:00
< a accesskey = "p" href = "sequence_facade.html" > < img src = "../../../../../../doc/html/images/prev.png" alt = "Prev" > < / a > < a accesskey = "u" href = "../extension.html" > < img src = "../../../../../../doc/html/images/up.png" alt = "Up" > < / a > < a accesskey = "h" href = "../../index.html" > < img src = "../../../../../../doc/html/images/home.png" alt = "Home" > < / a > < a accesskey = "n" href = "../functional.html" > < img src = "../../../../../../doc/html/images/next.png" alt = "Next" > < / a >
2007-11-06 12:13:52 +00:00
< / div >
< / body >
< / html >