I have a code something like this:
template <typename T> inline typename ::std::enable_if< is_std_tuple<T>{}, T >::type get() {
To deduce the type parameters of the template with which the tuple was created, I did this casting:
static_cast<T*>(nullptr)
and pass this as a function parameter
template <typename ...A> void deduce_tuple(::std::tuple<A...>* const);
Am I doing UB? Is there a better way?
source share