Function object implementing less-than comparison and hashing by path, to support sorting infos, using them as keys, and other interactions with the STL.
| 104 | /// path, to support sorting infos, using them as keys, and other |
| 105 | /// interactions with the STL. |
| 106 | struct ByPath { |
| 107 | bool operator()(const FileInfo& l, const FileInfo& r) const { |
| 108 | return l.path() < r.path(); |
| 109 | } |
| 110 | |
| 111 | size_t operator()(const FileInfo& i) const { |
| 112 | return std::hash<std::string>{}(i.path()); |
| 113 | } |
| 114 | }; |
| 115 | |
| 116 | protected: |
| 117 | std::string path_; |