• Class / Function / Type

      std::
    • Header file

      <>
    • Other / All

    最終更新日時(UTC):
    が更新

    履歴 編集

    function
    <system_error>

    std::error_category::operator!=

    // operator==により、以下の演算子が使用可能になる (C++20)
    bool operator!=(const error_category& rhs) const noexcept; // (1) C++11
    

    概要

    error_categoryが異なるオブジェクトかどうかを判定する。

    異なるオブジェクトであればtrue、そうでなければfalseを返す。

    戻り値

    !(*this == rhs)

    例外

    投げない

    #include <iostream>
    #include <system_error>
    
    int main()
    {
      const std::error_category& a = std::generic_category();
      const std::error_category& b = std::generic_category();
      const std::error_category& c = std::system_category();
    
      std::cout << std::boolalpha;
    
      std::cout << (a != b) << std::endl;
      std::cout << (a != c) << std::endl;
    }
    

    出力

    false
    true
    

    バージョン

    言語

    • C++11

    処理系

    参照