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

履歴 編集

function
<filesystem>

std::filesystem::directory_entry::operator>(C++17)

// operator<=>により、以下のオーバーロードが使用可能になる (C++20)
bool operator>(const directory_entry& rhs) const noexcept; // (1) C++17

概要

directory_entryオブジェクトにおいて、左辺が右辺より大きいかの判定を行う。

戻り値

return path() > rhs.path();

例外

投げない

#include <iostream>
#include <filesystem>

namespace fs = std::filesystem;

int main()
{
  fs::directory_entry x{"b.txt"};
  fs::directory_entry y{"a.txt"};

  if (x > y) {
    std::cout << "greater" << std::endl;
  }
}

出力

greater

バージョン

言語

  • C++17

処理系

参照