Skip to content

Latest commit

 

History

History
59 lines (45 loc) · 1.15 KB

File metadata and controls

59 lines (45 loc) · 1.15 KB

operator<=

  • filesystem[meta header]
  • std::filesystem[meta namespace]
  • function[meta id-type]
  • cpp17[meta cpp]
namespace std::filesystem {
  // operator<=>により、以下のオーバーロードが使用可能になる (C++20)
  bool operator<=(const path& lhs, const path& rhs) noexcept; // (1) C++17
}

概要

pathクラスにおいて、左辺が右辺以下かの判定を行う。

戻り値

return !(rhs < lhs);

例

#include <cassert>
#include <filesystem>

namespace fs = std::filesystem;

int main()
{
  fs::path a = "a/b/c";
  fs::path b = "a/b/d";

  assert(a <= b);
  assert(a <= a);
}
  • a <= b[color ff0000]
  • a <= a[color ff0000]

出力

バージョン

言語

  • C++17

処理系

  • Clang: 9.0.1 [mark verified]
  • GCC: 8.1 [mark verified]
  • Visual C++: 2017 Update 7 [mark verified]

参照