On this page
std::basic_stacktrace<Allocator>::basic_stacktrace
|
(1) | (since C++23) |
|
(2) | (since C++23) |
|
(3) | (since C++23) |
|
(4) | (since C++23) |
|
(5) | (since C++23) |
|
(6) | (since C++23) |
Constructs an empty basic_stacktrace
, or copy/move from other
.
basic_stacktrace
with a default-constructed allocator.
basic_stacktrace
using alloc
as the allocator.
basic_stacktrace
with 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())
.
basic_stacktrace
with 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.
alloc
is used as the allocator.
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.
Parameters
alloc | - | allocator to use for all memory allocations of the constructed basic_stacktrace |
other | - | another basic_stacktrace to copy/move from |
Exceptions
noexcept
specification:
noexcept(std::is_nothrow_default_constructible_v<allocator_type>)
Complexity
other
.
other
.
other
if alloc != other.get_allocator()
, otherwise constant.
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.
Example
See also
assigns to the basic_stacktrace (public member function) |
|
[static]
|
obtains the current stacktrace or its given part (public static member function) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/utility/basic_stacktrace/basic_stacktrace