Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-04-14 20:08:10


----- Original Message -----
From: "Aleksey Gurtovoy" <agurtovoy_at_[hidden]>

> Secondly, some of such examples were posted as early as 4 month ago.
In
> particular, Mat Marcus have shown how implement Loki's
'GenLinearHierarchy'
> using MPL facilities - in one line of actual code:
>
> template< typename Types, typename Unit, typename Root = mpl::none
>
> struct gen_linear_hierarchy
> {
> typedef typename mpl::fold<Types,Unit,Root>::type type; //
here
> };

Or, better:

    template< typename Types, typename Unit, typename Root = mpl::none >
    struct gen_linear_hierarchy
        : mpl::fold<Types,Unit,Root> {};

-Dave


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