std::type_index::operator==,!=,<,<=,>,>= - cppreference.com

##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::type_index::operator==,!=,<,<=,>,>=

From cppreference.com
< cpp‎ | types‎ | type index

bool operator==( const type_index& rhs ) const; |  | (since C++11)
bool operator!=( const type_index& rhs ) const; |  | (since C++11)
bool operator<( const type_index& rhs ) const; |  | (since C++11)
bool operator<=( const type_index& rhs ) const; |  | (since C++11)
bool operator>( const type_index& rhs ) const; |  | (since C++11)
bool operator>=( const type_index& rhs ) const; |  | (since C++11)

Compares the underlying std::type_info objects.

1-2) Checks whether the underlying std::type_info objects refer to the same type.

3-6) Compares the underlying std::type_info objects as defined by an implementation-defined ordering. The comparison is done by `type_info::before`.

### [edit] Parameters

rhs | - | another `type_index` object to compare to

### [edit] Return value

1) true if the underlying std::type_info objects refer to the same type, false otherwise

2) true if the underlying std::type_info objects refer not to the same type, false otherwise

3-6) true if the types referred by the underlying std::type_info objects are ordered by corresponding order, false otherwise.

### [edit] Exceptions

`noexcept` specification:
noexcept
Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/types/type_index/operator_cmp&oldid=63070"
Category:

- unconditionally noexcept