Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::basic_stacktrace<Allocator>::current

      From cppreference.com
      <cpp‎ |utility‎ |basic stacktrace
       
       
      Diagnostics library
       
       
      static basic_stacktrace current(const allocator_type& alloc=
                                           allocator_type())noexcept;
      (1)(since C++23)
      static basic_stacktrace current( size_type skip,const allocator_type& alloc=
                                           allocator_type())noexcept;
      (2)(since C++23)
      static basic_stacktrace current( size_type skip, size_type max_depth,

                                       const allocator_type& alloc=

                                           allocator_type())noexcept;
      (3)(since C++23)

      Lets[i] (0 ≤i <n) denote the (i+1)-th stacktrace entry in the stacktrace of the current evaluation in the current thread of execution, wheren is the count of the stacktrace entries in the stackentry.

      1) Attempts to create abasic_stacktrace consisting ofs[0],s[1], ...,s[n-1].
      2) Attempts to create abasic_stacktrace consisting ofs[m],s[m+1], ...,s[n-1], wherem ismin(skip,n).
      3) Attempts to create abasic_stacktrace consisting ofs[m],s[m+1], ...,s[o-1], wherem ismin(skip,n) ando ismin(skip + max_depth,n). The behavior is undefined if theskip+ max_depth< skip (i.e. the mathematical result ofskip+ max_depth overflows).

      In all cases,alloc is stored into the createdbasic_stacktrace and used to allocate the storage for stacktrace entries.

      Contents

      [edit]Parameters

      alloc - allocator to use for all memory allocations of the constructedbasic_stacktrace
      skip - the number of stacktrace entries to skip
      max_depth - the maximum depth of the stacktrace entries

      [edit]Return value

      If the allocation succeeds, thebasic_stacktrace described above.

      Otherwise, an emptybasic_stacktrace.

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]See also

      creates a newbasic_stacktrace
      (public member function)[edit]
      [static]
      constructs a newsource_location corresponding to the location of the call site
      (public static member function ofstd::source_location)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/utility/basic_stacktrace/current&oldid=139559"

      [8]ページ先頭

      ©2009-2025 Movatter.jp