Kris Braun
Dave Abrahams wrote:
Your best bet is to write an type generator: template <class Iterator> struct simple_iterator { typedef boost::transform_iterator< do_nothing< typename Iterator::value_type > , Iterator > type; };
Thank you for the quick and clear reply! I'm now having a very similar problem with a slightly more complicated example (that builds on the first):
template< class Iterator > struct harder_iterator { typedef simple_iterator< Iterator >::type inner_type; typedef boost::indirect_iterator< inner_type > type;
static type Create( const Iterator& iter ) { return type( inner_type( iter ) ); } };
This "composite" iterator not only has problems with comparison, but assignment from non-const to const as well. Is there a way to handle this case?
Need more details. Post a reproducible test that fails compilation and I might be able to solve your problem. -- Dave Abrahams Boost Consulting www.boost-consulting.com