std::type_index:: operator==,!=,<,<=,>,>=,<=>
From cppreference.net
<
cpp
|
types
|
type index
C++
Utilities library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Type support
| Basic types | |||||||||||||||||||||
| Fixed width integer types (C++11) | |||||||||||||||||||||
| Fixed width floating-point types (C++23) | |||||||||||||||||||||
|
|||||||||||||||||||||
| Numeric limits | |||||||||||||||||||||
| C numeric limits interface | |||||||||||||||||||||
| Runtime type information | |||||||||||||||||||||
|
|||||||||||||||||||||
std::type_index
| Member functions | ||||
|
type_index::operator=
type_index::operator!=
type_index::operator<
type_index::operator<=
type_index::operator>
type_index::operator>=
type_index::operator<=>
(until C++20)
(C++20)
|
||||
| Helper classes | ||||
|
(C++11)
|
|
bool
operator
==
(
const
type_index
&
rhs
)
const
noexcept
;
|
(1) | (C++11以降) |
|
bool
operator
!
=
(
const
type_index
&
rhs
)
const
noexcept
;
|
(2) |
(C++11以降)
(C++20以前) |
|
bool
operator
<
(
const
type_index
&
rhs
)
const
noexcept
;
|
(3) | (C++11以降) |
|
bool
operator
<=
(
const
type_index
&
rhs
)
const
noexcept
;
|
(4) | (C++11以降) |
|
bool
operator
>
(
const
type_index
&
rhs
)
const
noexcept
;
|
(5) | (C++11以降) |
|
bool
operator
>=
(
const
type_index
&
rhs
)
const
noexcept
;
|
(6) | (C++11以降) |
|
std::
strong_ordering
operator
<=>
(
const
type_index
&
rhs
)
const
noexcept
;
|
(7) | (C++20以降) |
基盤となる std::type_info オブジェクトを比較します。
1,2)
基盤となる
std::type_info
オブジェクトが同じ型を参照しているかどうかをチェックします。
|
|
(C++20以降) |
パラメータ
| rhs | - |
比較対象の別の
type_index
オブジェクト
|
戻り値
7)
std
::
strong_ordering
::
equal
基底の
std::type_info
オブジェクトが同じ型を参照する場合、そうでない場合は
std
::
strong_ordering
::
less
、
*
this
の基底
std::type_info
オブジェクトが実装定義の順序で
rhs
のオブジェクトより先行する場合、そうでない場合は
std
::
strong_ordering
::
greater
。