|
Boost : |
From: shunsuke (pstade.mb_at_[hidden])
Date: 2007-11-22 18:58:32
Joel de Guzman wrote:
> I think you misunderstood some of my previous posts. value_of is only
> used to compute the desired result. There is actually no corresponding
> value_of function. It is only a metafunction, unlike /at/ which has
> both a result_of metafunction and a function. When the input sequence
> is actually traversed to generate the result, /at/ is the one being
> called. Hence, the sequence above is what is actually generated by
> as_vector.
> It's unfortunate and a bit unintuitive to be using the result_of scheme
> to compute the value_at metafunction here. MPL uses the nested "apply"
> for this purpose. OTOH, it would be annoying to have to use "apply"
> for value_at and "result" for /at/. It's a compromise.
I might probably understand this problem.
transform_view, in order to implement `deref` etc, uses `result_of`
in the standard manner, where `result<F(int)> means that rvalue is passed.
But, as_vector applied to transform_view uses `result_of` in a strange manner
through value_of.
A FunctionObject for transform_view requires two result_of implementations;
It seems impossible.
Regards,
-- Shunsuke Sogame
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk