std::type_i...or==,!=,,>=,(3)
π NAME π
okay so bestie, welcome to the std::type_i...or==,!=,,>=,(3) manual page from the C++ Standard Libary β yes, βLibaryβ is literally how the header spells it, not me π. The NAME section is giving βsomeone sat on the keyboard,β but we keep it exact:
std::type_index::operator==,!=,,>=, -
std::type_index::operator==,!=,,>=,
β¨ Synopsis β¨
These are the comparison operators for std::type_index, and no cap, every single one is const noexcept β we love a low-drama signature π«Ά. The numbers and the since / until notes are preserved exactly:
bool operator==( const type_index& rhs ) const noexcept;
(1) (since C++11)
bool operator!=( const type_index& rhs ) const noexcept;
(2) (since C++11)
(until C++20)
bool operator<( const type_index& rhs ) const noexcept;
(3) (since C++11)
bool operator<=( const type_index& rhs ) const noexcept;
(4) (since C++11)
bool operator>( const type_index& rhs ) const noexcept;
(5) (since C++11)
bool operator>=( const type_index& rhs ) const noexcept;
(6) (since C++11)
std::strong_ordering operator<=>( const type_index& rhs ) const
(7) (since C++20)
noexcept;
Then the actual tea: it compares the underlying std::type_info objects.
- 1,2) checks whether the underlying
std::type_infoobjects refer to the same type. - 3-7) compares the underlying
std::type_infoobjects as defined by an implementation-defined ordering. The comparison is done bytype_info::before.
Also important icon behavior: the != operator is synthesized from operator==. (since C++20)
π Parameters π
rhsβ anothertype_indexobject to compare to
π Return value π
- 1)
trueif the underlyingstd::type_infoobjects refer to the same type,falseotherwise. - 2)
trueif the underlyingstd::type_infoobjects refer not to the same type,falseotherwise. - 3-6)
trueif the types referred by the underlyingstd::type_infoobjects are ordered by corresponding order,falseotherwise. - 7)
std::strong_ordering::equalif the underlyingstd::type_infoobjects refer to the same type, otherwisestd::strong_ordering::lessif*this's underlyingstd::type_infoobject precedesrhs's in the implementation-defined ordering, otherwisestd::strong_ordering::greater.
periodt π
mwah π this page came from http://cppreference.com, stamped 2024.06.10, and filed under std::type_i...or==,!=,,>=,(3). go off bestie π«Άβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms