Oops, SFINAE doesn't work even in `using type = has_or_has_no_type<T>::type;`.
Let me modify a bit:
template <class T>
struct X {
static consteval std::meta::info evaluate()
{ if (std::meta::is_same_type(^^T, ^^int)) return { }; else ...
}
static constexpr auto result = evaluate();
};
template <class T> concept C = requires { typename [:
X<T>::result :]; };
static_assert(!C<int>); // error: cannot
splice a null reflection
template <class T>
struct X {
static consteval std::meta::info evaluate()
{ if (std::meta::is_same_type(^^T, ^^int)) return { }; else ... }
using type = [: evaluate() :];
};
template <class T> concept C = requires { typename X<T>::type; };
static_assert(!C<int>); // error: cannot splice a null reflection
I don't know why it is. Can somebody explain?