The following code does not compile on g++ (GCC) 4.6.0 20110603 (prerelease) with -std=c++0x and Boost 1.46.1 . Am I missing inclusion or is this really a bug? If the latter, how to get around it?
#include <boost/mpl/vector.hpp> #include <boost/mpl/transform.hpp> #include <boost/mpl/clear.hpp> #include <boost/fusion/mpl.hpp> #include <boost/fusion/include/clear.hpp> #include <boost/fusion/include/clear.hpp> #include <boost/fusion/adapted/boost_tuple.hpp> #include <boost/fusion/include/boost_tuple.hpp> namespace mpl = boost::mpl; template<typename T> struct Meta { T t; typedef mpl::vector<std::function<void(double)>, std::function<void(char)>, std::function<void(int)>> MplVector; typedef T FusionSequence; //works typedef mpl::transform< MplVector, mpl::identity<mpl::_1> >::type result; //doesn't, work typedef typename mpl::transform< FusionSequence, mpl::identity<mpl::_1> >::type result2; }; template<typename T> Meta<T> make_meta(T t) { return Meta<T>({t}); } int main() { auto m = make_meta(boost::make_tuple( std::function<void(double)>([](double) { }), std::function<void(int)>([](int) { }), std::function<void(char)>([](char) { }))); }
source share