public member function
<typeindex>

std::type_index::operator

(1)
bool operator== (const type_index& rhs) const noexcept;
(2)
bool operator!= (const type_index& rhs) const noexcept;
(3)
bool operator<  (const type_index& rhs) const noexcept;
(4)
bool operator<= (const type_index& rhs) const noexcept;
(5)
bool operator>  (const type_index& rhs) const noexcept;
(6)
bool operator>= (const type_index& rhs) const noexcept;
type_index operators
Compares the type_index object to rhs.

For the equality and non-equality comparisons (== and !=), the function uses the same operator directly on the type_info object they refer (see type_info::operator==).

For the other relational operators, the function uses type_info::before to determine their relative order.

Note also that the assignment operator is implicitly declared, copying the internal reference kept by the object.

Parameters

rhs
type_index object to the right-hand side of the operator.

Return Value

true if the condition holds.
false otherwise.

Data races

No data races are initiated by these member functions.

Exception safety

No-throw guarantee: never throw exceptions.

See also