c++ - Is there any static vector of types? -
is there static (compiler-time) vector of types? example, can type given constant integer index, following
vector<int, float>::type<0> int vector<int, float>::type<1> float
if want manipulate vector of types @ compile time, can use boost::mpl::vector
boost.mpl library. beware, head might explode.
using namespace boost::mpl; typedef at_c<vector<int, float>, 0>::type t1; // int typedef at_c<vector<int, float>, 1>::type t2; // float
http://www.boost.org/doc/libs/1_54_0/libs/mpl/doc/refmanual/vector.html
Comments
Post a Comment