
Joel de Guzman wrote:
Well, it's just for that specific case. Did you intend the transform to be generic? I didn't think so when you had it hard coded to int. I guess, it really depends on what your intent is. A transform cannot, in general, return a reference. What if the input is computed on the fly, like, say:
mpl::vector_c<int, 1, 2, 3>
?
Yes, a FunctionObject return type is often orthogonal to deref type of sequence. In such case, a higher-order function is needed to avoid dangling: make_function_returning_value(identity_returning_reference()) Well, my question is more primitive: What is "value_at"? The current implementation is: value_at of transform_view returns boost::result_of<F(value_at of its underlying sequence)>::type I couldn't understand what this implementation wants to do. 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. Regards, -- Shunsuke Sogame