[polymorphic.obs]

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

## 20.4 Types for composite class design [[mem.composite.types]](mem.composite.types#polymorphic.obs)

### 20.4.2 Class template polymorphic [[polymorphic]](polymorphic#obs)

#### 20.4.2.6 Observers [polymorphic.obs]

[ð](#lib:operator*,polymorphic)

`constexpr const T& operator*() const noexcept;
constexpr T& operator*() noexcept;
`

[1](#1)

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

*Preconditions*: *this is not valueless[.](#1.sentence-1)

[2](#2)

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

*Returns*: A reference to the owned object[.](#2.sentence-1)

[ð](#lib:operator-%3e,polymorphic)

`constexpr const_pointer operator->() const noexcept;
constexpr pointer operator->() noexcept;
`

[3](#3)

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

*Preconditions*: *this is not valueless[.](#3.sentence-1)

[4](#4)

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

*Returns*: A pointer to the owned object[.](#4.sentence-1)

[ð](#lib:valueless_after_move,polymorphic)

`constexpr bool valueless_after_move() const noexcept;
`

[5](#5)

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

*Returns*: true if *this is valueless, otherwise false[.](#5.sentence-1)

[ð](#lib:get_allocator,polymorphic)

`constexpr allocator_type get_allocator() const noexcept;
`

[6](#6)

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

*Returns*: *alloc*[.](#6.sentence-1)
