std::filesystem::hash_value - cppreference.com

##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::filesystem::hash_value

From cppreference.com
< cpp‎ | filesystem‎ | path

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

### [edit] Parameters

p | - | a std::filesystem::path object

### [edit] Return value

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

### [edit] Exceptions

`noexcept` specification:
noexcept

### [edit] Notes

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)

### [edit] Example

| This section is incomplete Reason: no example

### [edit] See also

compare | compares the lexical representations of two paths lexicographically (public member function) [edit]
hash (C++11) | hash function object (class template) [edit]

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/filesystem/path/hash_value&oldid=91530"
Categories:

- unconditionally noexcept
- Todo no example

Hidden categories:

- Pages with unreviewed unconditional noexcept template
- Pages with unreviewed noexcept template