C++ Logo

std-discussion

Advanced search

Why isn't using `type = [: evaluate() :]; ` SFINAE?

From: Bingzhi <bingzhi2025_at_[hidden]>
Date: Thu, 17 Sep 2026 00:20:13 +0800
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?

Received on 2026-09-16 16:20:23