std::derived_from
|
定义于头文件
<concepts> |
||
|
template< class Derived, class Base >
concept derived_from = |
(C++20 起) | |
概念 derived_from<Derived, Base> 若且唯若忽略 cv 限定符后 Base 是类类型,且它为 Derived 或是 Derived 的公开无歧义基类才得到满足。
注意当 Base 是 Derived 的私有或受保护基类时,此行为异于 std::is_base_of 。
参阅
|
(C++11)
|
检查一个类型是否派生自另一个类型 (类模板) |
|
(C++11)(C++20)
|
检查是否能转换一个类型为另一类型 (类模板) |