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

履歴 編集

function
<system_error>

std::operator<(C++11)

namespace std {
  // operator<=>により、以下の演算子が使用可能になる (C++20)
  bool
    operator<(const error_condition& lhs,
              const error_condition& rhs) noexcept; // (1) C++11
}

概要

error_conditionにおいて、左辺が右辺より小さいかの比較を行う。

戻り値

return lhs.category() < rhs.category() || lhs.category() == rhs.category() && lhs.value() < rhs.value();

例外

投げない

#include <iostream>
#include <system_error>

int main()
{
  std::error_condition ed1 = std::make_error_condition(std::errc::invalid_argument);
  std::error_condition ed2 = std::make_error_condition(std::errc::permission_denied);

  std::cout << std::boolalpha;
  std::cout << (ed1 < ed2) << std::endl;
}

出力

false

バージョン

言語

  • C++11

処理系

参照