[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 indirect {public:using value_type = T; using allocator_type = Allocator; using pointer = typename allocator_traits::pointer; using const_pointer = typename allocator_traits::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*); templateconstexpr explicit indirect(U&& u); templateconstexpr explicit indirect(allocator_arg_t, const Allocator& a, U&& u); templateconstexpr explicit indirect(in_place_t, Us&&... us); templateconstexpr explicit indirect(allocator_arg_t, const Allocator& a, in_place_t, Us&&... us); templateconstexpr explicit indirect(in_place_t, initializer_list ilist, Us&&... us); templateconstexpr explicit indirect(allocator_arg_t, const Allocator& a, in_place_t, initializer_list 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*); templateconstexpr 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 operatorstemplatefriend constexpr bool operator==(const indirect& lhs, const indirect& rhs)noexcept(*see below*); templatefriend constexpr auto operator<=>(const indirect& lhs, const indirect& rhs)-> *synth-three-way-result*; // [[indirect.comp.with.t]](indirect.comp.with.t "20.4.1.9 Comparison with T"), comparison with Ttemplatefriend constexpr bool operator==(const indirect& lhs, const U& rhs) noexcept(*see below*); templatefriend constexpr auto operator<=>(const indirect& lhs, const U& rhs)-> *synth-three-way-result*; private: pointer *p*; // *exposition only* Allocator *alloc* = Allocator(); // *exposition only*}; template indirect(Value) -> indirect; template indirect(allocator_arg_t, Allocator, Value)-> indirect::template rebind_alloc>;}