
8 May
2009
8 May
'09
6:37 p.m.
template <typename... Types> class tuple ... { template <typename N> auto operator[](std::size_t n = N) -> constexpr decltype(get<N>(*this)) { return get<N>(*this); } }; If this is possible, you could do (and it would be way more natural than get<3>(t)): tuple<int, float, float, string, mytype> t; t[3] = "hello"; But I feel this is not legal because of parameter std::size_t :(.