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

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -