A concept-id like std::same_as<int, double>
is evaluated like an expression. It produces a prvalue of type bool
.
[temp.names]
8 A concept-id is a simple-template-id where the template-name is
a concept-name. A concept-id is a prvalue of type bool, and does not
name a template specialization. A concept-id evaluates to true if the
concept's normalized constraint-expression is satisfied
([temp.constr.constr]) by the specified template arguments and false
otherwise.
So decltype
is reporting it correctly. In an expression, it's a bool
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…