Boost logo

Boost :

From: David B. Held (dheld_at_[hidden])
Date: 2003-10-23 01:53:42

Is it possible to detect whether a template parameter is
an MPL container or not? I would like to be able to do
something roughly like this:

template <typename T>
struct foo
    typedef if_<is_mpl_container<T>::type,
>::type my_type;

Actually, what I would really like to do is create an array
of objects based on the types in T if T is an MPL container,
and an array of 1 if it's not. That way, I can say:

foo<int> f;


foo<mpl::list<int, double, char> > f;


Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
Version: 6.0.521 / Virus Database: 319 - Release Date: 9/23/2003

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