Boost logo

Boost Users :

From: Kris Braun (kris_braun_at_[hidden])
Date: 2004-02-24 13:47:51


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?

Thanks,
Kris

__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools


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