Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2004-07-01 13:38:15


Angus Leeming <angus.leeming_at_[hidden]> writes:

> David Abrahams wrote:
>> Why struggle?
>>
>> boost::transform_iterator should give you just what you need:
>
> Many thanks, David.
>
> That's altogether much nicer. However, result_of is not part of boost 1.31.
> Attached is an implementation of my code that works fine with 1.31.
> Unfortunately, I can't create a 'const_first_iterator' from a
> 'first_iterator'. Ie, I need:
>
> store my_store;
> store const & my_const_store = my_store; // UGLY!
> store::const_first_iterator const begin = my_const_store.begin_first();
> store::const_first_iterator const end = my_const_store.end_first();
>
> Any further clues, or is this as far as I can go this way?

See the converting constructor described at
http://tinyurl.com/229ld#transform-iterator-synopsis. As long as the
underlying iterators and unaryfunctions are convertible, the
initialization should work just fine.

> Angus
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users

-- 
Dave Abrahams
Boost Consulting
http://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