$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-users] is this possible with tuples in c++0x ?
From: Germán Diago (germandiago_at_[hidden])
Date: 2009-05-08 20:37:40
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 :(.