[util.smartptr.owner.hash]

# 20 Memory management library [[mem]](./#mem)

## 20.3 Smart pointers [[smartptr]](smartptr#util.smartptr.owner.hash)

### 20.3.2 Shared-ownership pointers [[util.sharedptr]](util.sharedptr#util.smartptr.owner.hash)

#### 20.3.2.5 Struct owner_hash [util.smartptr.owner.hash]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/memory.tex#L5201)

The class owner_hash provides ownership-based hashing[.](#1.sentence-1)

[ð](#lib:owner_hash)

namespace std {struct owner_hash {template<class T> size_t operator()(const shared_ptr<T>&) const noexcept; template<class T> size_t operator()(const weak_ptr<T>&) const noexcept; using is_transparent = *unspecified*; };}

[ð](#lib:operator(),owner_hash)

`template<class T>
  size_t operator()(const shared_ptr<T>& x) const noexcept;
template<class T>
  size_t operator()(const weak_ptr<T>& x) const noexcept;
`

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/memory.tex#L5228)

*Returns*: x.owner_hash()[.](#2.sentence-1)

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/memory.tex#L5232)

[*Note [1](#note-1)*:

For any object y where x.owner_equal(y) is true,x.owner_hash() == y.owner_hash() is true[.](#3.sentence-1)

â *end note*]
