Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-10-10 06:19:01


Brian McNamara <lorgon_at_[hidden]> writes:

> Suppose we have a tuple of inner_value_types (T,U,V...) and we want to
> transform it into a tuple of outer_value_types (T*,U*,V*,...) because we
> intend to iterate over the data in the tuple with the functoid (or
> "UnaryResultOfCallable" object) "heapify":
>
> heapify( T x ) means { return new T(x); } // make a copy on the heap
>
> Then, assuming all the things we've been discussing, I think that the
> MPL code ends up looking like
>
> typedef mpl::transform<
> inner_value_types
> , result_of<heapify_type>
> >::type outer_value_types;
>
> Is this good? It is certainly not bad, but in the role of "take a
> functoid and turn it into a metafunction", I am not sure that
> "result_of" is the best name. That is, I think it might "read" better
> as
>
> typedef mpl::transform<
> inner_value_types
> , as_result_type_metafunction<heapify_type> // note difference
> >::type outer_value_types;
>
> or something. Again, I cannot think of a terse name which effectively
> communicates "take a functoid and turn it into a metafunction". But I
> don't think that "result_of" is the best name for this.

Why not? I do.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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