Following code fails to compile, unless constexpr qualifier is removed from visitType:
https://godbolt.org/z/899fWhdGe
struct visitor {
template < typename T >
static auto visit() {
return visitType< T >();
}
template < typename T >
static constexpr void visitType() {
visit< typename T::next_type>();
}
};
struct iface {
using next_type = iface;
};
void foo()
{
visitor::visit<iface>();
}