Why does std :: tuple break up into rvalue links?
#include <tuple> template <typename, typename> struct same_type; template <typename T> struct same_type<T, T> {}; void foo() { std::tuple tuple(1, 'a', 2.3, true); auto[i, c, d, b] = tuple; same_type<decltype(i), int &&>{}; same_type<decltype(c), char &&>{}; same_type<decltype(d), double &&>{}; same_type<decltype(b), bool &&>{}; }
This compiles without errors using the gcc trunk. I would expect simple types like
same_type<decltype(i), int>{};
Real time example
source share