Boost logo

Boost :

From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2002-04-02 15:13:58


Vesa Karvonen wrote:
> >I think we can make the placeholders work, though perhaps under a
> >different syntax that above, e.g.:
> >
> >typedef variant<int, float, string, rec1<aggr, variant_self> > value;
> [snip]
>
> If I recall correctly, the above has the problem that it is
> not portable when used with standard containers, because
> a standard container template may have extra defaulted template
> parameters. This breaks the template template parameter match.
>
> > // rec2, rec3, etc. should be pretty obvious
>
> Hopefully there is a way to avoid using names that include
> the number of parameters. I don't know if an ideal solution exists
> within the current C++ core language. Member templates would
> probably mean more work for users.

MPL's lambda facility can allow us to do this:

    typedef variant<int, float, string, aggr<_1> > value;
   // or 'typedef variant<int, float, string, aggr<_> > value;'

Aleksey


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