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,
        begin<T>::type,
        T
>::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;

or:

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

Dave

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

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