Difference between revisions of "cpp/utility/stacktrace entry"
From cppreference.com
(→Helper classes: P2693R1) |
m (→Notes: ~FTM) |
||
Line 45: | Line 45: | ||
===Notes=== | ===Notes=== | ||
{{tt|boost::stacktrace::frame}} (available in [https://www.boost.org/doc/libs/release/doc/html/stacktrace.html Boost.Stacktrace]) can be used instead when {{tt|std::stacktrace_entry}} is not available. | {{tt|boost::stacktrace::frame}} (available in [https://www.boost.org/doc/libs/release/doc/html/stacktrace.html Boost.Stacktrace]) can be used instead when {{tt|std::stacktrace_entry}} is not available. | ||
− | {{feature test macro|__cpp_lib_stacktrace|std=C++23|value=202011L}} | + | {{feature test macro|__cpp_lib_stacktrace|std=C++23|value=202011L|[[cpp/error#Stacktrace|Stacktrace library]]}} |
===Example=== | ===Example=== |
Revision as of 02:55, 26 July 2023
Defined in header <stacktrace>
|
||
class stacktrace_entry; |
(since C++23) | |
The stacktrace_entry
class provides operations for querying information about an evaluation in a stacktrace. Each stacktrace_entry
object is either empty, or represents an evaluation in a stacktrace.
stacktrace_entry
models std::regular and std::three_way_comparable<std::strong_ordering>.
Contents |
Member types
native_handle_type (C++23)
|
implementation-defined native handle type |
Member functions
constructs a new stacktrace_entry (public member function) | |
(destructor) (C++23) |
destroys the stacktrace_entry (public member function) |
(C++23) |
assigns the contents of one stacktrace_entry to another (public member function) |
Observers | |
(C++23) |
gets the implementation-defined native handle of the stacktrace_entry (public member function) |
(C++23) |
checks whether the stacktrace_entry is empty (public member function) |
Query | |
(C++23) |
gets the description of the evaluation represented by the stacktrace_entry (public member function) |
gets the name of the source file that lexically contains the expression or statement whose evaluation is represented by the stacktrace_entry (public member function) | |
gets the line number that lexically relates the evaluation represented by the stacktrace_entry (public member function) |
Non-member functions
(C++23) |
compares two stacktrace_entry values (function) |
(C++23) |
returns a string with a description of the stacktrace_entry (function) |
(C++23) |
performs stream output of stacktrace_entry (function template) |
Helper classes
hash support for std::stacktrace_entry (class template specialization) | |
formatting support for stacktrace_entry (class template specialization) |
Notes
boost::stacktrace::frame
(available in Boost.Stacktrace) can be used instead when std::stacktrace_entry
is not available.
Feature-test macro | Value | Std | Feature |
---|---|---|---|
__cpp_lib_stacktrace |
202011L | (C++23) | Stacktrace library |
Example
This section is incomplete Reason: no example |
See also
(C++23) |
approximate representation of an invocation sequence consists of stacktrace entries (class template) |
(C++20) |
a class representing information about the source code, such as file names, line numbers, and function names (class) |