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

c++ - What's the differece between of link to a dynamic file and as a input object? -

javascript - Feed FileReader from server side files -

Android Unit Testing / Mockito: android.location.Location not mocked -