Boost logo

Boost :

From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2005-01-12 15:54:32


"Andy Little" <andy_at_[hidden]> wrote in message

> Does this mean it may (eventually) be possible to use template template
> params in BOOST_TYPEOF ?

Not yet :(

What I am trying to achieve is much more modest: I want to extract template
and a number of parameters from an unregistered type to achieve a more
descriptive assertion. So that instead of :

can't instantiate boost::typeof::encode_type<class std::map<class
std::basic_string<char,
struct std::char_traits<char>,class std::allocator<char> >,class
std::basic_stri
ng<char,struct std::char_traits<char>,class std::allocator<char> >,struct
std::l
ess<class std::basic_string<char,struct std::char_traits<char>,class
std::alloca
tor<char> > >,class std::allocator<struct std::pair<class
std::basic_string<char
,struct std::char_traits<char>,class std::allocator<char> > const ,class
std::ba
sic_string<char,struct std::char_traits<char>,class std::allocator<char> > >
> >

I could get something like this:

MPL standard assertion text(boost::type_of::unknown_template_4<std::map>)

Kind of exersize while reading the MPL book :)

One problem that I have with mpl::template_arity, though, is that it seems
to be undocumented... And therefore probably an internal feature?

As for your question however, the conceptual problem with template template
parameters is that they can't be returned from meta-functions:

template<template<class> class T> class X
{
    // I know T here, but how do I pass it outside???
};

Of course, they can be wrapped... I am wondering whether it would be
possible to use this....

But again, not yet :)

Regards,

Arkadiy


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