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

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -