
That looks pretty cool. This could be useful in Fit as well for fit::unpack. * there's no known to me way to make get<>() method constexpr
On gcc and clang, you could try something like this: #define CONST_FOLD(x) (__builtin_constant_p(x) ? (x) : (x)) template <std::size_t I, class T> constexpr decltype(auto) get(const T& val) noexcept { auto t = CONST_FOLD(reinterpret_cast<const decltype(detail::as_tuple<T>())*>( std::addressof(val) )); return get<I>(*t); } Of course, this requires the user to always use `CONST_FOLD` when calling get as well. There might be a better way. Paul
-- Best regards, Antony Polukhin
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost