Files
2025-10-25 03:02:53 +03:00

1.2 KiB
Raw Permalink Blame History

[util.smartptr.hash]

20 Memory management library [mem]

20.3 Smart pointers [smartptr]

20.3.3 Smart pointer hash support [util.smartptr.hash]

🔗

template<class T, class D> struct hash<unique_ptr<T, D>>;

1

#

Letting UP be unique_ptr<T, D>, the specialization hash is enabled ([unord.hash]) if and only if hash<typename UP::pointer> is enabled.

When enabled, for an object p of type UP,hash()(p) evaluates to the same value as hash<typename UP::pointer>()(p.get()).

The member functions are not guaranteed to be noexcept.

🔗

template<class T> struct hash<shared_ptr<T>>;

2

#

For an object p of type shared_ptr,hash<shared_ptr>()(p) evaluates to the same value as hash<typename shared_ptr::element_type*>()(p.get()).