c11 template class with multiple definitions

C++14 and newer:

template <typename T, typename ...P>
struct A
{
    std::conditional_t<sizeof...(P) == 0, T, std::tuple<T, P...>> value;
};

C++11:

template <typename T, typename ...P>
struct A
{
    typename std::conditional<sizeof...(P) == 0, T, std::tuple<T, P...>>::type value;
};

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top