c++ - How to make std::get to be member method(s)? -


std::get link gets elements of tuple. overloaded function has number of versions. if have class derived tuple, , want introduce member method get() tuple elements using std::get. need write member method each version of std::get or can write one?

template<class... args> class data     : public std::tuple<args...> { public:     typedef std::tuple<args...> tuplety;      // 1 version.     template<unsigned n>     (typename std::tuple_element<n, tuplety>::type)& get()     {         return std::get<n>(*this);     } }; 


Comments

Popular posts from this blog

javascript - Unusual behaviour when drawing lots of images onto a large canvas -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -