std::filesystem::hash_value (3) - Linux Manuals

std::filesystem::hash_value: std::filesystem::hash_value


std::filesystem::hash_value - std::filesystem::hash_value


Defined in header <filesystem>
std::size_t hash_value( const path& p ) noexcept; (since C++17)


p - a std::filesystem::path object

Return value

A hash value such that if for two paths, p1 == p2 then hash_value(p1) == hash_value(p2).


Equality of two paths is determined by comparing each component separately, so, for example "a//b" equals "a/b" and has the same hash_value
hash_value originates from the boost.filesystem library where it was used for interoperability with boost.hash (which calls_hash_value where available)


 This section is incomplete
 Reason: no example

See also

        compares the lexical representations of two paths lexicographically
compare (public member function)

hash hash function object
        (class template)