This commit is contained in:
2025-10-25 03:02:53 +03:00
commit 043225d523
3416 changed files with 681196 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
[polymorphic.syn]
# 20 Memory management library [[mem]](./#mem)
## 20.4 Types for composite class design [[mem.composite.types]](mem.composite.types#polymorphic.syn)
### 20.4.2 Class template polymorphic [[polymorphic]](polymorphic#syn)
#### 20.4.2.2 Synopsis [polymorphic.syn]
[🔗](#lib:polymorphic)
namespace std {template<class T, class Allocator = allocator<T>>class polymorphic {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; // [[polymorphic.ctor]](polymorphic.ctor "20.4.2.3Constructors"), constructorsconstexpr explicit polymorphic(); constexpr explicit polymorphic(allocator_arg_t, const Allocator& a); constexpr polymorphic(const polymorphic& other); constexpr polymorphic(allocator_arg_t, const Allocator& a, const polymorphic& other); constexpr polymorphic(polymorphic&& other) noexcept; constexpr polymorphic(allocator_arg_t, const Allocator& a, polymorphic&& other)noexcept(*see below*); template<class U = T>constexpr explicit polymorphic(U&& u); template<class U = T>constexpr explicit polymorphic(allocator_arg_t, const Allocator& a, U&& u); template<class U, class... Ts>constexpr explicit polymorphic(in_place_type_t<U>, Ts&&... ts); template<class U, class... Ts>constexpr explicit polymorphic(allocator_arg_t, const Allocator& a,
in_place_type_t<U>, Ts&&... ts); template<class U, class I, class... Us>constexpr explicit polymorphic(in_place_type_t<U>, initializer_list<I> ilist, Us&&... us); template<class U, class I, class... Us>constexpr explicit polymorphic(allocator_arg_t, const Allocator& a,
in_place_type_t<U>, initializer_list<I> ilist, Us&&... us); // [[polymorphic.dtor]](polymorphic.dtor "20.4.2.4Destructor"), destructorconstexpr ~polymorphic(); // [[polymorphic.assign]](polymorphic.assign "20.4.2.5Assignment"), assignmentconstexpr polymorphic& operator=(const polymorphic& other); constexpr polymorphic& operator=(polymorphic&& other) noexcept(*see below*); // [[polymorphic.obs]](polymorphic.obs "20.4.2.6Observers"), observersconstexpr 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; // [[polymorphic.swap]](polymorphic.swap "20.4.2.7Swap"), swapconstexpr void swap(polymorphic& other) noexcept(*see below*); friend constexpr void swap(polymorphic& lhs, polymorphic& rhs) noexcept(*see below*); private: Allocator *alloc* = Allocator(); // *exposition only*};}