Boost logo

Boost Users :

Subject: Re: [Boost-users] [fusion] transform & iterators
From: Joel de Guzman (joel_at_[hidden])
Date: 2010-03-11 02:50:14


On 3/11/2010 12:11 PM, David A. Greene wrote:
> For the first attached testcase, can anyone explain why "Doesn't"
> doesn't?

Because fusion::transform is purely functional --takes its arguments
as const and returns a transformed view and returns a view which is
also const (immutable). In that regard, fusion is more like MPL
(functional) than STL (imperative).

> I would not expect the second test to compile. But is there some way to
> bridge the gap between fusion iterators, boost.Range ranges and standard
> iterators? Is there any way to turn a fusion iterator into a standard-
> conforming iterator?

There's no way I know that would allow that. First, fusion iterators
have different types for each iterator position, unlike STL where
begin and end and everything in between have a single iterator type.
IOTW, fusion iterators are polymorphic.

Regards,

-- 
Joel de Guzman
http://www.boostpro.com
http://spirit.sf.net
http://www.facebook.com/djowel
Meet me at BoostCon
http://www.boostcon.com/home
http://www.facebook.com/boostcon

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