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
Post a Comment