I want make a class template like below:
template < typename... Args > class VectorTuple;
by example,
VectorTuple < long, double, string >
will instanced as
Tuple < vector < long >, vector < double > , vector < string > >
I am not familiar to variadic-templates. The worst method is to copy code from < tuple > and modify it. Is there an easy way to just directly use std::tuple to define my VectorTuple.
If you are looking for typedef
the variadic-templates
type then,
template<typename... Args>
using VectorTuple = std::tuple<std::vector<Args>...>;
Now you can use it like
VectorTuple<long, double, std::string> obj;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With