Boost logo

Boost Users :

Subject: [Boost-users] mpl and mpl::vector_c
From: peter_foelsche_at_[hidden]
Date: 2008-09-26 19:46:42


I'm having a hard time trying to understand meta-programming.
I have a template class

template<class CDB>
struct MyClass
{ template<class CDB0, class CDB1>
        typedef MyClass<mpl::transform<CDB0, CDB1, mpl::or<_1, _2> > > Or;

        template<class CDB0, class CDB1>
        friend Or<CDB0, CDB1> myOperation(MyClass<CDB0> &_r0, MyClass<CDB1> &_r1);
};

The template argument will be of type

mpl::vector_c<bool, arg0, arg1, ...>

All the vectors will be of equal length.
Now the function myOperation is supposed to iterate over both the vectors at the same time and do different operations depending on the value of both vectors at this position.

I could generate a mpl::vector<std::pair<bool, bool>, ..>
but I really don't know how.
Any help would be appreciated.

Peter


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