Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-08-08 07:56:26

"David B. Held" <dheld_at_[hidden]> writes:

> It seems to me that in a policy-based design, the main class needs
> to know if the policies are metafunctions or metafunction classes.
> Now, I was under the impression, based on what Aleksey said a long
> time ago, that these are basically interchangeable through a lambda-
> based policy adaptor.

No, metafunction classes and *lambda expressions* are interchangeable
through lambda.

        lambda<my<lambda_expr, _1, ession<_2> > >::type

is a metafunction class qeuivalent to:

        template <class A1, class A2>
        struct apply
            typedef typename my<
              , A1
              , typename ession<A2>::type
>::type type;



is a metafunction class equivalent to


Don't pass metafunctions directly; it's bad for interoperability.
Then you get a metafunction taking a template template parameter, and
you can't use it in lambda expressions.


Dave Abrahams
Boost Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at