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

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

比较底层 std::type_info 对象。

1-2) 检查底层的 std::type_info对象是否表示同一类型。

3-6) 按实现定义顺序的定义,比较底层 std::type_info 对象。比较由 type_info::before 执行。

参数

rhs - 要比较的另一 type_index 对象

返回值

1) 若底层 std::type_info 对象表示同一类型则为 true ,否则为 false

2) 若底层 std::type_info 对象不表示同一类型则为 true ,否则为 false

3-6) 若底层 std::type_info 所表示的类型按对应顺序排列,则为 true ,否则为 false

版本历史

  • (当前 | 先前 2017年11月18日 (六) 00:02Fruderica讨论 | 贡献 . . (1,383字节) (+17). . (撤销)
  • 当前 | 先前 2017年6月14日 (三) 01:34Fruderica讨论 | 贡献 . . (1,366字节) (-263). . (noexcept) (撤销)
  • 当前 | 先前 2017年2月9日 (四) 08:16Fruderica讨论 | 贡献. . (1,629字节) (-750). . (撤销)
  • 当前 | 先前 2013年7月2日 (二) 11:55P12bot讨论 | 贡献 . . (2,379字节) (-182). . (Use {{lc}}. Update links. Various fixes.) (撤销)
  • 当前 | 先前 2012年11月2日 (五) 13:51P12bot讨论 | 贡献 . . (2,561字节) (+329). . (r2.7.3) (机器人添加:de, en, es, fr, it, ja, pt, ru) (撤销)
  • 当前 | 先前 2012年10月27日 (六) 12:44P12讨论 | 贡献 . . (2,232字节) (0). . (1个修订: Translate from the English version) (撤销)
  • 当前 | 先前 2012年10月26日 (五) 06:00TranslationBot讨论 | 贡献. . (2,232字节) (-44). . (Translated from the English version using Google Translate) (撤销)
  • 当前 | 先前 2012年10月26日 (五) 04:09P12讨论 | 贡献 . . (2,276字节) (0). . (1个修订: Translate from the English version) (撤销)
  • 当前 | 先前) 2012年10月25日 (四) 12:00TranslationBot讨论 | 贡献. . (2,276字节) (+2,276). . (Translated from the English version using Google Translate)