Boost logo

Boost :

From: Nicolas Fleury (nidoizo_at_[hidden])
Date: 2006-06-20 11:33:01


Is there something like a is_specialization in Boost.Traits? Something
like:

template <typename TypeT, template<typename> class TemplateTypeT>
struct is_specialization
{
private:
     template <typename T>
     static char foo( TemplateTypeT<T>* );
     static int foo( ... );
public:
     enum { value = (sizeof(is_specialization::foo((TypeT*)0)) ==
sizeof(char)) } ;
};

It's very limited since it only supports a specific number of template
arguments. The number of template arguments could be passed, but it
would still cause problems with non-type template arguments. Any ideas?

Maybe something like:
BOOST_IS_SPECIALIZATION(type, templateType, signature)
called like:
BOOST_IS_SPECIALIZATION(myType, std::list, (typename, typename))

Regards,
Nicolas


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