std::hash<std::indirect>
From cppreference.com
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Memory management library
(exposition only*)
(C++11)
(C++23)
(C++11)
(C++17)
(C++11)
(C++11)
(C++20)
(C++20)
(C++17)
(C++11)
(C++17)
(C++20)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
Uninitialized storage (until C++20)
(until C++20*)
(until C++20*)
(until C++20*)
Garbage collector support (until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)
(C++11)
(C++17)
(C++20)
(C++17)
(C++11)
(C++11)
(C++11)
(until C++17*)
(C++11)
(C++17)
(C++26)
(C++26)
(C++11)
(C++11)
(C++11)
(C++23)
(C++23)
(C++11)
(C++20)
(C++11)
(C++11)
(C++20)
(C++26)
std::indirect
hash<std::indirect>
Defined in header
<memory>
template< class T, class Allocator >
struct hash<std::indirect<T, Allocator>>;
(since C++26)
struct hash<std::indirect<T, Allocator>>;
The partial specialization of std::hash for std::indirect allows users to obtain hashes of the objects owned by indirect
objects.
The specialization std::hash <std::indirect<T, Allocator>> is enabled if std::hash <T> is enabled, and is disabled otherwise.
When enabled, for an object obj of type std::indirect<T, Allocator>, std::hash <std::indirect<T, Allocator>>()(obj) evaluates to:
- std::hash <T>()(*obj), if obj is not valueless.
- An implementation-defined value, if obj is valueless.
The member functions of this specialization are not guaranteed to be noexcept because the hash of T
might throw.
[edit] Example
This section is incomplete
Reason: no example
Reason: no example