3.5 KiB
[indirect.syn]
20 Memory management library [mem]
20.4 Types for composite class design [mem.composite.types]
20.4.1 Class template indirect [indirect]
20.4.1.2 Synopsis [indirect.syn]
namespace std {template<class T, class Allocator = allocator>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], 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); 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 ilist, Us&&... us); template<class I, class... Us>constexpr explicit indirect(allocator_arg_t, const Allocator& a, in_place_t, initializer_list ilist, Us&&... us); // [indirect.dtor], destructorconstexpr ~indirect(); // [indirect.assign], assignmentconstexpr indirect& operator=(const indirect& other); constexpr indirect& operator=(indirect&& other) noexcept(see below); templateconstexpr indirect& operator=(U&& u); // [indirect.obs], 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], swapconstexpr void swap(indirect& other) noexcept(see below); friend constexpr void swap(indirect& lhs, indirect& rhs) noexcept(see below); // [indirect.relops], 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], 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<T, U>; private: pointer p; // exposition only Allocator alloc = Allocator(); // exposition only}; template indirect(Value) -> indirect; template<class Allocator, class Value> indirect(allocator_arg_t, Allocator, Value)-> indirect<Value, typename allocator_traits::template rebind_alloc>;}