Date
2010-10-21.18:28:33
Message id
4663

Content

Proposed resolution:

Add the following declarations to the synopsis of <memory> in [memory]

// [util.smartptr.hash] hash support
template <class T> struct hash;
template <class T, class D> struct hash<unique_ptr<T,D>>;
template <class T> struct hash<shared_ptr<T>>;

Add a new subclause under [util.smartptr] called hash support

hash support [util.smartptr.hash]

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

Specialization meeting the requirements of class template hash ([unord.hash]). For an object p of type UP, where UP is a type unique_ptr<T,D>, hash<UP>()(p) shall evaluate to the same value as hash<typename UP::pointer>()(p.get()). The specialization hash<typename UP::pointer> is required to be well-formed.

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

Specialization meeting the requirements of class template hash ([unord.hash]). 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()).