23 Containers library [containers]

23.3 Sequence containers [sequences]

23.3.9 Class template hive [hive]

23.3.9.2 Constructors, copy, and assignment [hive.cons]

constexpr explicit hive(const Allocator&) noexcept;
Effects: Constructs an empty hive, using the specified allocator.
Complexity: Constant.
constexpr hive(hive_limits block_limits, const Allocator&);
Effects: Constructs an empty hive, using the specified allocator.
Initializes current-limits with block_limits.
Complexity: Constant.
explicit hive(size_type n, const Allocator& = Allocator()); hive(size_type n, hive_limits block_limits, const Allocator& = Allocator());
Preconditions: T is Cpp17DefaultInsertable into hive.
Effects: Constructs a hive with n default-inserted elements, using the specified allocator.
If the second overload is called, also initializes current-limits with block_limits.
Complexity: Linear in n.
hive(size_type n, const T& value, const Allocator& = Allocator()); hive(size_type n, const T& value, hive_limits block_limits, const Allocator& = Allocator());
Preconditions: T is Cpp17CopyInsertable into hive.
Effects: Constructs a hive with n copies of value, using the specified allocator.
If the second overload is called, also initializes current-limits with block_limits.
Complexity: Linear in n.
template<class InputIterator> hive(InputIterator first, InputIterator last, const Allocator& = Allocator()); template<class InputIterator> hive(InputIterator first, InputIterator last, hive_limits block_limits, const Allocator& = Allocator());
Effects: Constructs a hive equal to the range [first, last), using the specified allocator.
If the second overload is called, also initializes current-limits with block_limits.
Complexity: Linear in distance(first, last).
template<container-compatible-range<T> R> hive(from_range_t, R&& rg, const Allocator& = Allocator()); template<container-compatible-range<T> R> hive(from_range_t, R&& rg, hive_limits block_limits, const Allocator& = Allocator());
Effects: Constructs a hive object with the elements of the range rg, using the specified allocator.
If the second overload is called, also initializes current-limits with block_limits.
Complexity: Linear in ranges​::​distance(rg).
hive(const hive& x); hive(const hive& x, const type_identity_t<Allocator>& alloc);
Preconditions: T is Cpp17CopyInsertable into hive.
Effects: Constructs a hive object with the elements of x.
If the second overload is called, uses alloc.
Initializes current-limits with x.current-limits.
Complexity: Linear in x.size().
hive(hive&& x); hive(hive&& x, const type_identity_t<Allocator>& alloc);
Preconditions: For the second overload, when allocator_traits<alloc>​::​is_always_equal​::​value is false, T meets the Cpp17MoveInsertable requirements.
Effects: When the first overload is called, or the second overload is called and alloc == x.get_allocator() is true, current-limits is set to x.current-limits and each element block is moved from x into *this.
Pointers and references to the elements of x now refer to those same elements but as members of *this.
Iterators referring to the elements of x will continue to refer to their elements, but they now behave as iterators into *this.
If the second overload is called and alloc == x.get_allocator() is false, each element in x is moved into *this.
References, pointers and iterators referring to the elements of x, as well as the past-the-end iterator of x, are invalidated.
Postconditions: x.empty() is true.
Complexity: If the second overload is called and alloc == x.get_allocator() is false, linear in x.size().
Otherwise constant.
hive(initializer_list<T> il, const Allocator& = Allocator()); hive(initializer_list<T> il, hive_limits block_limits, const Allocator& = Allocator());
Preconditions: T is Cpp17CopyInsertable into hive.
Effects: Constructs a hive object with the elements of il, using the specified allocator.
If the second overload is called, also initializes current-limits with block_limits.
Complexity: Linear in il.size().
hive& operator=(const hive& x);
Preconditions: T is Cpp17CopyInsertable into hive and Cpp17CopyAssignable.
Effects: All elements in *this are either copy-assigned to, or destroyed.
All elements in x are copied into *this.
[Note 1: 
current-limits is unchanged.
β€” end note]
Complexity: Linear in size() + x.size().
hive& operator=(hive&& x) noexcept(allocator_traits<Allocator>::propagate_on_container_move_assignment::value || allocator_traits<Allocator>::is_always_equal::value);
Preconditions: When (allocator_traits<Allocator>::propagate_on_container_move_assignment::value || allocator_traits<Allocator>::is_always_equal::value) is false, T is Cpp17MoveInsertable into hive and Cpp17MoveAssignable.
Effects: Each element in *this is either move-assigned to, or destroyed.
When (allocator_traits<Allocator>::propagate_on_container_move_assignment::value || get_allocator() == x.get_allocator()) is true, current-limits is set to x.current-limits and each element block is moved from x into *this.
Pointers and references to the elements of x now refer to those same elements but as members of *this.
Iterators referring to the elements of x will continue to refer to their elements, but they now behave as iterators into *this, not into x.
When (allocator_traits<Allocator>::propagate_on_container_move_assignment::value || get_allocator() == x.get_allocator()) is false, each element in x is moved into *this.
References, pointers and iterators referring to the elements of x, as well as the past-the-end iterator of x, are invalidated.
Postconditions: x.empty() is true.
Complexity: Linear in size().
If (allocator_traits<Allocator>::propagate_on_container_move_assignment::value || get_allocator() == x.get_allocator()) is false, also linear in x.size().