id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 1020,Boost.Iterator proposal to add is_constant_iterator,andysem@…,jeffrey.hellrung,"I propose to add a new trait to the Boost.Iterator library: `is_constant_iterator`. The trait is applied to an iterator and returns true if the iterator's reference type is a constant reference and false if the type is a non-constant reference. The trait will fail to compile when applied to iterators having non-reference reference types. This addition would make it easier to use library components like `iterator_facade` and `iterator_adaptor` for implementing container iterator wrappers like this: {{{ template< NodeItT > struct MyIterator : public iterator_facade< MyIterator< NodeItT >, typename mpl::if_< is_constant_iterator< NodeItT >, const value_type, value_type >::type, typename iterator_category< NodeItT >::type > { }; }}} Here `NodeItT` is a wrapped iterator and may be a `const_iterator` or `iterator` of a container. Another use case is when a user wants to detect whether an iterator is `const_iterator` or `iterator`. An example of this: implementing functionality of iterator translation similar to Boost.MultiIndex `project` method. I've attached an archive with the implementation, tests and patches to documentation. The implementation, in addition to the abovementioned functionality, supports `std::vector< bool >` iterators, though their reference types are not references. ",Patches,new,Boost 1.36.0,iterator,,Not Applicable,,is_constant_iterator,