Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-11-01 14:53:42


Aleksey Gurtovoy <agurtovoy_at_[hidden]> writes:

> <digression>
> Of course ideally Fusion and MPL should interpolate

Do you mean interoperate?

> so that the above could be written as
>
> struct make_vehicle
> {
> template< typename T > struct result
> {
> typedef vehicle* type;
> };
>
> template< typename T >
> vehicle* operator()(identity<T>, vehicle* ptr) const
> {
> return new T(ptr);
> }
> };
>
> int main()
> {
> vehicle* result = fusion::fold(
> fusion::identity_view< mpl::vector<vehicle,car,bicycle,train>
>>()
> , static_cast<vehicle*>(0)
> , make_vehicle
> );
>
> return 0;
> }
> </digression>

I'm not sure why that's an improvement. Is identity_view supposed to
default-construct a vehicle,car, bicycle, and train?

-- 
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