c++ - using std::tuple to construct a vector-based dataset refer to variadic-templates -


i want make class template below:

template < typename... args > class vectortuple; 

by example,

vectortuple < long, double, string > 

will instanced

tuple < vector < long >, vector < double > , vector < string > > 

i not familiar variadic-templates. worst method copy code < tuple > , modify it. there easy way directly use std::tuple define vectortuple.

if looking typedef variadic-templates type then,

template<typename... args> using vectortuple = std::tuple<std::vector<args>...>; 

now can use like

vectortuple<long, double, std::string> obj; 

Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -