Boost logo

Boost Users :

From: spider tong (spidertong_at_[hidden])
Date: 2007-10-25 11:22:02


Hi all,

I'm trying to use mpl::remove to do some processing with a template
parameter, like this

template<typename T0, typename T1=null_type, ... typename Tn=null_type>
struct my_class
{
    typedef mpl::vector<T0, T1,...Tn> my_vector;
    typedef mpl::remove<my_vector, null_type>::type my_non_vector; //failed
here
};

Compiler report that my_vector is not derive from my_class<T0, T1,..Tn>.
It seems that 'remove' would test the sequence at once, and my_vector still
un_known yet, so it fails, is this guess right?

//--------------------------------------------------------------------------

And I've tried this fusion too:

teypdef vector<Class1, Class2, null_type, null_type> vec;
vec v;
fusion::for_each<v, print>;

it seems that it iterate 4 times, not 2, even size(vec) return 2. It seems
only evaluate will skip null_type, iterate will go through all member, is my
guess right?

Best Regards
Spider



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net