i create class, contains private attribut :
template<typename ta, typename t2, ... tn> // use <typename... tn> ? class { public: a(){}; ~a(){}; std::tuple<std::vector<std::reference_wrapper<t1>>, std::vector<std::reference_wrapper<t2>>, ...> t; }; but able write simple :
a<int, double, std::string> a; and automatically builds corresponding :
std::tuple<std::vector<std::reference_wrapper<int>>, std::vector<std::reference_wrapper<double>>, std::vector<std::reference_wrapper<std::string>>> t; (for number of arguments in tuple)
so want transform t std::reference_wrapper< t > , pass tuple. how can ? !
just expand pack:
template <typename ...args> struct foo { std::tuple<std::vector<std::reference_wrapper<args>>...> t; };
Comments
Post a Comment