Boost logo

Boost :

Subject: Re: [boost] [RangeEx] Using istream_range?
From: Jeff Flinn (TriumphSprint2000_at_[hidden])
Date: 2008-10-22 12:14:31


Mathias Gaunard wrote:
> Robert Jones wrote:
>
>> But this code doesn't....
>
>> vals | adaptors :: transformed( _1 * 2 ),
>
> Without even testing, I assume that is because _1 * 2 does not allow the
> result type to be extracted using result_of.
> RangeEx forwards that to make_transform_iterator which requires it.
>
> I personally overcame this issue by modifying the RangeEx library so
> that it wraps the functor into another one that will define result_type
> using typeof. That's a fairly ugly hack.
> A better way might to be
> - make result_of compatible with boost.lambda sig thingy, which might or
> might not help in some cases
> - allow boost.typeof to be used in result_of, in which cases result_of
> will always work, albeit not reference-correctly.

Hmm, I wonder if the current Phoenix would work?

Jeff


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk