[indirect.syn]

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

## 20.4 Types for composite class design [[mem.composite.types]](mem.composite.types#indirect.syn)

### 20.4.1 Class template indirect [[indirect]](indirect#syn)

#### 20.4.1.2 Synopsis [indirect.syn]

[ð](#lib:indirect)

namespace std {template<class T, class Allocator = allocator<T>>class indirect {public:using value_type = T; using allocator_type = Allocator; using pointer = typename allocator_traits<Allocator>::pointer; using const_pointer = typename allocator_traits<Allocator>::const_pointer; // [[indirect.ctor]](indirect.ctor "20.4.1.3 Constructors"), constructorsconstexpr explicit indirect(); constexpr explicit indirect(allocator_arg_t, const Allocator& a); constexpr indirect(const indirect& other); constexpr indirect(allocator_arg_t, const Allocator& a, const indirect& other); constexpr indirect(indirect&& other) noexcept; constexpr indirect(allocator_arg_t, const Allocator& a, indirect&& other)noexcept(*see below*); template<class U = T>constexpr explicit indirect(U&& u); template<class U = T>constexpr explicit indirect(allocator_arg_t, const Allocator& a, U&& u); template<class... Us>constexpr explicit indirect(in_place_t, Us&&... us); template<class... Us>constexpr explicit indirect(allocator_arg_t, const Allocator& a,
 in_place_t, Us&&... us); template<class I, class... Us>constexpr explicit indirect(in_place_t, initializer_list<I> ilist, Us&&... us); template<class I, class... Us>constexpr explicit indirect(allocator_arg_t, const Allocator& a,
 in_place_t, initializer_list<I> ilist, Us&&... us); // [[indirect.dtor]](indirect.dtor "20.4.1.4 Destructor"), destructorconstexpr ~indirect(); // [[indirect.assign]](indirect.assign "20.4.1.5 Assignment"), assignmentconstexpr indirect& operator=(const indirect& other); constexpr indirect& operator=(indirect&& other) noexcept(*see below*); template<class U = T>constexpr indirect& operator=(U&& u); // [[indirect.obs]](indirect.obs "20.4.1.6 Observers"), observersconstexpr const T& operator*() const & noexcept; constexpr T& operator*() & noexcept; constexpr const T&& operator*() const && noexcept; constexpr T&& operator*() && noexcept; constexpr const_pointer operator->() const noexcept; constexpr pointer operator->() noexcept; constexpr bool valueless_after_move() const noexcept; constexpr allocator_type get_allocator() const noexcept; // [[indirect.swap]](indirect.swap "20.4.1.7 Swap"), swapconstexpr void swap(indirect& other) noexcept(*see below*); friend constexpr void swap(indirect& lhs, indirect& rhs) noexcept(*see below*); // [[indirect.relops]](indirect.relops "20.4.1.8 Relational operators"), relational operatorstemplate<class U, class AA>friend constexpr bool operator==(const indirect& lhs, const indirect<U, AA>& rhs)noexcept(*see below*); template<class U, class AA>friend constexpr auto operator<=>(const indirect& lhs, const indirect<U, AA>& rhs)-> *synth-three-way-result*<T, U>; // [[indirect.comp.with.t]](indirect.comp.with.t "20.4.1.9 Comparison with T"), comparison with Ttemplate<class U>friend constexpr bool operator==(const indirect& lhs, const U& rhs) noexcept(*see below*); template<class U>friend constexpr auto operator<=>(const indirect& lhs, const U& rhs)-> *synth-three-way-result*<T, U>; private: pointer *p*; // *exposition only* Allocator *alloc* = Allocator(); // *exposition only*}; template<class Value> indirect(Value) -> indirect<Value>; template<class Allocator, class Value> indirect(allocator_arg_t, Allocator, Value)-> indirect<Value, typename allocator_traits<Allocator>::template rebind_alloc<Value>>;}
