Skip to content

Latest commit

 

History

History
52 lines (40 loc) · 809 Bytes

File metadata and controls

52 lines (40 loc) · 809 Bytes

operator<

  • filesystem[meta header]
  • std::filesystem[meta namespace]
  • function[meta id-type]
  • cpp17[meta cpp]
namespace std::filesystem {
  bool operator<(const path& lhs, const path& rhs) noexcept;
}

概要

pathクラスにおいて、左辺が右辺より小さいかの判定を行う。

戻り値

return lhs.compare(rhs) < 0;
  • compare[link compare.md]

#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);
}
  • a < b[color ff0000]

出力

バージョン

言語

  • C++17

処理系