[Iterator] const and an iterator's value_type
In the documentation of iterator_facade it is stated that: "The C++ standard requires an iterator's value_type not be const-qualified, so iterator_facade strips the const from its Value parameter in order to produce the iterator's value_type. Making the Value argument const provides a useful hint to iterator_facade that the iterator is a constant iterator, and the default Reference argument will be correct for all lvalue iterators." and "when defining a constant lvalue iterator, the user can pass a const-qualified version of the iterator's value_type as iterator_facade's Value parameter and omit the Reference parameter which follows." Am I to understand from this that iterator_facade<Derived,T const,Category> is equivalent to iterator_facade<Derived,T,Category,T const&>, and likewise for iterator_adaptor? D.
participants (1)
-
Daniel Mitchell