Created on 2015-12-13.00:00:00 last changed 90 months ago
Proposed resolution:
This wording is relative to N4562.
Insert a new subclause after [memory.smartptr.shared.cast]:
[Note for the editor: The synopses in [header.memory.synop] and [memory.smartptr.shared] should be updated to refer to the new subclause rather than C++14 §20.8.2.7]
?.?.?.? shared_ptr hash support [memory.smartptr.shared.hash]
template <class T> struct hash<experimental::shared_ptr<T>>;-1- The template specialization shall meet the requirements of class template hash (C++14 §20.9.12). For an object p of type experimental::shared_ptr<T>, hash<experimental::shared_ptr<T>>()(p) shall evaluate to the same value as hash<typename experimental::shared_ptr<T>::element_type*>()(p.get()).
Addresses: fund.ts.v2
The library fundamentals TS does not provide a separate specification for std::hash<std::experimental::shared_ptr<T>>, deferring to the C++14 specification in §20.8.2.7/3:
template <class T> struct hash<shared_ptr<T> >;-3- The template specialization shall meet the requirements of class template hash (20.9.13). For an object p of type shared_ptr<T>, hash<shared_ptr<T> >()(p) shall evaluate to the same value as hash<T*>()(p.get()).
That specification doesn't work if T is an array type (U[N] or U[]), as in this case get() returns U*, which cannot be hashed by std::hash<T*>.
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-07-30 20:10:41 | admin | set | status: wp -> open |
2016-06-28 12:52:37 | admin | set | status: ready -> wp |
2016-03-07 04:46:57 | admin | set | status: new -> ready |
2015-12-19 15:37:12 | admin | set | messages: + msg7664 |
2015-12-13 00:00:00 | admin | create |