In a dummy example of a class
typedef myStruct>> mv;
int
is the innermost
Building on 0x499602D2's answer, we get the following to only consider the first template parameter if ever there are several. And yes it compiles. It's also slightly simpler.
#include
#include
#include
template
struct innermost_impl
{
using type = T;
};
template class E, typename Head, typename... Tail>
struct innermost_impl>
{
using type = typename innermost_impl::type;
};
template
using innermost = typename innermost_impl::type;
template
struct X;
static_assert(std::is_same>>>, int>::value, "");
static_assert(
std::is_same>>>, int>::value,
""
);
int main()
{
}
Note that no attempt is made to validate that the same template is used over and over.