How to use std::tuple types with boost::mpl algorithms?
问题 The boost::mpl algorithms seem not to be able to work on std::tuple types out of the box, e.g., the following does not compile (boost-1.46.0, g++ snapshot 2011-02-19): #include <tuple> #include <boost/mpl/vector.hpp> #include <boost/mpl/contains.hpp> namespace mpl=boost::mpl; typedef mpl::vector<int,float,bool> types; static_assert(mpl::contains<types, float>::value, "vector contains bool"); typedef std::tuple<int,float,bool> types2; // the following does not compile: // error: no class