以下代码不能g++ (GCC) 4.6.0 20110603 (prerelease)
使用-std=c++0x
and编译Boost 1.46.1
。我错过了包含还是这实际上是一个错误?如果是后者,如何解决?
#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) { })));
}