Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::basic_stacktrace<Allocator>::basic_stacktrace

      From cppreference.com
      <cpp‎ |utility‎ |basic stacktrace
       
       
      Diagnostics library
       
       
      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 emptybasic_stacktrace, or copy/move fromother.

      1) Default constructor. Constructs an emptybasic_stacktrace with a default-constructed allocator.
      2) Constructs an emptybasic_stacktrace usingalloc as the allocator.
      3) Copy constructor. Constructs abasic_stacktrace with the copy of the contents ofother, the allocator is obtained as if by callingstd::allocator_traits<allocator_type>::select_on_container_copy_construction(other.get_allocator()).
      4) Move constructor. Constructs abasic_stacktrace with the contents ofother using move semantics. Allocator is move-constructed from that ofother. After construction,other is left in a valid but unspecified state.
      5) Same as the copy constructor, except thatalloc is used as the allocator.
      6) Behaves same as the move constructor ifalloc== other.get_allocator(). Otherwise, allocates memory withalloc and performs element-wise move.alloc is used as the allocator.

      (3,5,6) may throw an exception or construct an emptybasic_stacktrace on allocation failure.

      Contents

      [edit]Parameters

      alloc - allocator to use for all memory allocations of the constructedbasic_stacktrace
      other - anotherbasic_stacktrace to copy/move from

      [edit]Exceptions

      1)
      noexcept specification:  
      noexcept(std::is_nothrow_default_constructible_v<allocator_type>)
      3,5,6) May propagate the exception thrown on allocation failure.

      [edit]Complexity

      1,2) Constant.
      3) Linear in size ofother.
      4) Constant.
      5) Linear in size ofother.
      6) Linear in size ofother ifalloc!= other.get_allocator(), otherwise constant.

      [edit]Notes

      After container move construction (overload(4)), references, pointers, and iterators (other than the end iterator) toother 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 viaLWG issue 2321.

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]See also

      assigns to thebasic_stacktrace
      (public member function)[edit]
      [static]
      obtains the current stacktrace or its given part
      (public static member function)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/utility/basic_stacktrace/basic_stacktrace&oldid=182679"

      [8]ページ先頭

      ©2009-2025 Movatter.jp