basic_stacktrace& operator=( const basic_stacktrace& other ); | (1) | (since C++23) |
basic_stacktrace& operator=( basic_stacktrace&& other ) noexcept(/* see below */); | (2) | (since C++23) |
Replaces the contents of the basic_stacktrace
.
other
.std::allocator_traits<allocator_type>::propagate_on_container_copy_assignment::value
is true
, the allocator of *this
is replaced by a copy of that of other
. If the allocator of *this
after assignment would compare unequal to its old value, the old allocator is used to deallocate the memory, then the new allocator is used to allocate it before copying the entries. Otherwise, the memory owned by *this
may be reused when possible. other
using move semantics (i.e. the data in other
is moved from other
into *this
). other
is in a valid but unspecified state afterwards.std::allocator_traits<allocator_type>::propagate_on_container_move_assignment::value
is true
, the allocator of *this
is replaced by a copy of that of other
. If it is false
and the allocators of *this
and other
do not compare equal, *this
cannot take ownership of the memory owned by other
and must assign each entries individually, allocating additional memory using its own allocator as needed.In any case, the stacktrace entries originally belong to *this
may be either destroyed or replaced by element-wise assignment.
*this
may be set to empty on allocation failure if the implementation strengthens the exception specification.
other | - | another basic_stacktrace to use as source |
*this
.
*this
and other
.*this
unless the allocators do not compare equal and do not propagate, in which case linear in the size of *this
and other
.noexcept
specification: noexcept(std::allocator_traits<Allocator>::propagate_on_container_move_assignment::value
|| std::allocator_traits<Allocator>::is_always_equal::value)
After container move assignment (overload (2)), unless element-wise move assignment is forced by incompatible allocators, references, pointers, and iterators (other than the end iterator) to other
remain valid, but refer to elements that are now in *this
. The current standard makes this guarantee via the blanket statement in [container.rev.reqmts]/17, and a more direct guarantee is under consideration via LWG 2321.
(C++23) | creates a new basic_stacktrace (public member function) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/utility/basic_stacktrace/operator%3D