Boost logo

Boost :

From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2002-12-17 17:32:35


David Abrahams wrote:
> Aleksey Gurtovoy <agurtovoy_at_[hidden]> writes:
> > Okay, from this moment MPL's lambda supports "reduced"
> > metafunction form directly (if detected):
> >
> > template< typename T > struct her
> > {
> > // no 'type' member!
> > };
> >
> > typedef lambda< her<_> >::type f;
> > typedef apply<f,int>::type t;
> >
> > BOOST_MPL_ASSERT_IS_SAME(t, her<int>);
> >
> > The "ordinary" metafunctions work as before.
>
> Ah!
>
> That answers my question...
>
> So if I want to generate a template instantiation that /happens/ to
> have a nested type (that's not identity), I can't use the reduced
> form.

Not implicitly. The 'reduced< my_func<_> >' notation will solve that.

> Interesting. You have to be a little bit careful with that reduced
> form then.

Sure :). But in majority of cases it gives you the most intuitive behavior.

Aleksey


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