Hi,
Lets say I have an mpl vector defined as :
template <typename Traits>
struct A
{
};
template <typename Traits>
struct B
{
};
typedef mpl::vector<A<mpl::_>, B<mpl::_> > MyVec;
struct MyTraits {};
How do I 'apply' or transform MyVec with MyTraits?
ie. I want the mpl::vector ...
boost::mpl::vector<A<MyTraits>, B<MyTraits>>;
I realise I can do mpl::apply<A<mpl::_>, MyTraits> to get A<MyTraits> but I can't work out how to do the equivalent to the entire vector.
mpl::transform seems like what I should be using. Transform seems to do apply internally, but I can't work out the syntax to do something like:
using substituted = typename boost::mpl::transform<MyVec, boost::mpl::apply<boost::mpl<_>, MyTraits> >::type;
(This isn't right!)
It may be I am confused because inside the transform, boost::mpl::_1 is the item in the vector, not the 'inner' placeholder.
Sorry if this is a basic question ...
Regards,
Andrew