I always was under the impression that types like std::is_same
, std::is_void
, or std::is_aggregate
are supposed to inherit from std::integral_constant
, or more specifically from std::bool_constant
.
However, aggregate classes must not have a base class by definition, but when I use these types as T
in std::is_aggregate_v<T>
, I get true
. So apparently, they are not derived from std::bool_constant
?
So my question is:
Why is std::is_aggregate_v<std::is_aggregate<void>>
true, at least with GCC and Clang? Doesn't the standard specify that std::is_aggregate
is derived from std::bool_constant
? If not, does this mean it leaves the value of the above line as an implementation detail?