Skip to content

Latest commit

 

History

History
65 lines (51 loc) · 1.44 KB

File metadata and controls

65 lines (51 loc) · 1.44 KB

operator<

  • system_error[meta header]
  • std[meta namespace]
  • function[meta id-type]
  • cpp11[meta cpp]
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();
  • category()[link category.md]
  • value()[link value.md]

例外

投げない

#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;
}
  • std::make_error_condition[link /reference/system_error/make_error_condition.md]
  • std::errc::invalid_argument[link /reference/system_error/errc.md]
  • std::errc::permission_denied[link /reference/system_error/errc.md]

出力

false

バージョン

言語

  • C++11

処理系

参照