Boost logo

Boost :

From: Joel de Guzman (joel_at_[hidden])
Date: 2007-11-21 23:29:49


shunsuke wrote:

> I tend to think `value_at` of transform_view should be the same as
> `result_of::deref` of transform_view.
> I'm not sure, though.

value_at (as well as value_of) returns (essentially):

     f(value_at<s>)

while at (as well as deref) returns (essentially):

     f(at<s>)

alas, this uncovers a bug in the implementation where value_at
does not follow above.

You got me thinking though. It could very well be that you are correct!
Perhaps we need the same behavior for both at/deref and value_at/value_of.
My thinking, OTOH, is that both should get the value_at of the underlying
sequence. Hence, transform(vector<int, int&>, f) will trigger
f this way:

     int ---> f::result<f(int)>
     int& ---> f::result<f(int&)>

do you see a reason why it should be the other way around?

Thanks to your keen sense!

Regards,

-- 
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net

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