std::basic_stacktrace::basic_stacktrace - cppreference.com (original) (raw)
| basic_stacktrace() noexcept(/* see below */); | (1) | (since C++23) |
|---|---|---|
| explicit basic_stacktrace( const allocator_type& alloc ) noexcept; | (2) | (since C++23) |
| basic_stacktrace( const basic_stacktrace& other ); | (3) | (since C++23) |
| basic_stacktrace( basic_stacktrace&& other ) noexcept; | (4) | (since C++23) |
| basic_stacktrace( const basic_stacktrace& other, const allocator_type& alloc ); | (5) | (since C++23) |
| basic_stacktrace( basic_stacktrace&& other, const allocator_type& alloc ); | (6) | (since C++23) |
Constructs an empty basic_stacktrace, or copy/move from other.
Default constructor. Constructs an empty
basic_stacktracewith a default-constructed allocator.Constructs an empty
basic_stacktraceusing alloc as the allocator.Copy constructor. Constructs a
basic_stacktracewith the copy of the contents of other, the allocator is obtained as if by calling std::allocator_traits<allocator_type>::select_on_container_copy_construction(other.get_allocator()).Move constructor. Constructs a
basic_stacktracewith the contents of other using move semantics. Allocator is move-constructed from that of other. After construction, other is left in a valid but unspecified state.Same as the copy constructor, except that alloc is used as the allocator.
Behaves same as the move constructor if alloc == other.get_allocator(). Otherwise, allocates memory with alloc and performs element-wise move. alloc is used as the allocator.
(3,5,6) may throw an exception or construct an empty basic_stacktrace on allocation failure.
[edit] Parameters
| alloc | - | allocator to use for all memory allocations of the constructed basic_stacktrace |
|---|---|---|
| other | - | another basic_stacktrace to copy/move from |
[edit] Exceptions
3,5,6) May propagate the exception thrown on allocation failure.
[edit] Complexity
1,2) Constant.
Linear in size of other.
Constant.
Linear in size of other.
Linear in size of other if alloc != other.get_allocator(), otherwise constant.
[edit] Notes
After container move construction (overload (4)), 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.reqmts]/67, and a more direct guarantee is under consideration via LWG issue 2321.
[edit] Example
[edit] See also
| | assigns to the basic_stacktrace (public member function) [edit] | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | | obtains the current stacktrace or its given part (public static member function) [edit] |