Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2005-11-01 14:21:43

I have an MPL sequence of metafunction classes. I want to apply<> each
with mpl::transform. So I did this:

   struct metafnclass
       template<typename T> struct apply
       { typedef T type; };

   typedef mpl::vector<metafnclass, metafnclass> metafnclasses;

   typedef mpl::transform<
     , mpl::apply<mpl::_1, int>
>::type transmetafnclasses;

This fails horribly, and I don't know why. If I add an indirection like

   template<typename T,typename U> struct indirect_apply
     : mpl::apply<T, U> {};

   typedef mpl::transform<
     , indirect_apply<mpl::_1, int>
>::type transmetafnclasses;

then it works fine. Why should that be? Is something getting evaluated
too eagerly?

Eric Niebler
Boost Consulting

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