Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2004-02-24 20:45:34


Kris Braun <kris_braun_at_[hidden]> writes:

> 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

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net