• Class / Function / Type

      std::
    • Header file

      <>
    • Other / All

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

    履歴 編集

    function
    <filesystem>

    std::filesystem::directory_entry::operator<=

    // 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{"a.txt"};
      fs::directory_entry y{"b.txt"};
    
      if (x <= y) {
        std::cout << "less equal" << std::endl;
      }
    }
    

    出力

    less equal
    

    バージョン

    言語

    • C++17

    処理系

    参照