Difference between revisions of "cpp/utility/stacktrace entry"
From cppreference.com
(P0881R7 stacktrace) |
YexuanXiao (Talk | contribs) m |
||
(13 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{cpp/title|stacktrace_entry}} | {{cpp/title|stacktrace_entry}} | ||
{{cpp/utility/stacktrace_entry/navbar}} | {{cpp/utility/stacktrace_entry/navbar}} | ||
− | {{ddcl | header=stacktrace | since=c++23 | | + | {{ddcl|header=stacktrace|since=c++23| |
class stacktrace_entry; | class stacktrace_entry; | ||
}} | }} | ||
Line 11: | Line 11: | ||
===Member types=== | ===Member types=== | ||
{{dsc begin}} | {{dsc begin}} | ||
− | {{dsc | + | {{dsc|{{tt|native_handle_type}}|implementation-defined native handle type}} |
{{dsc end}} | {{dsc end}} | ||
===Member functions=== | ===Member functions=== | ||
{{dsc begin}} | {{dsc begin}} | ||
− | {{dsc | + | {{dsc inc|cpp/utility/stacktrace_entry/dsc constructor}} |
− | {{dsc mem dtor | | + | {{dsc mem dtor|nolink=true|destroys the {{tt|stacktrace_entry}}}} |
− | {{dsc mem fun | cpp/utility/stacktrace_entry/operator{{= | + | {{dsc mem fun|cpp/utility/stacktrace_entry/operator{{=}}|assigns the contents of one {{tt|stacktrace_entry}} to another}} |
− | {{dsc h2 | Observers}} | + | {{dsc h2|Observers}} |
− | {{dsc mem fun | cpp/utility/stacktrace_entry/native_handle | + | {{dsc mem fun|cpp/utility/stacktrace_entry/native_handle|gets the implementation-defined native handle of the {{tt|stacktrace_entry}}}} |
− | {{dsc mem fun | cpp/utility/stacktrace_entry/operator bool | + | {{dsc mem fun|cpp/utility/stacktrace_entry/operator bool|checks whether the {{tt|stacktrace_entry}} is empty}} |
− | {{dsc h2 | Query}} | + | {{dsc h2|Query}} |
− | {{dsc mem fun | cpp/utility/stacktrace_entry/description | + | {{dsc mem fun|cpp/utility/stacktrace_entry/description|gets the description of the evaluation represented by the {{tt|stacktrace_entry}}}} |
− | {{dsc | + | {{dsc inc|cpp/utility/stacktrace_entry/dsc source_file}} |
− | {{dsc | + | {{dsc inc|cpp/utility/stacktrace_entry/dsc source_line}} |
{{dsc end}} | {{dsc end}} | ||
===Non-member functions=== | ===Non-member functions=== | ||
{{dsc begin}} | {{dsc begin}} | ||
− | {{dsc fun | cpp/utility/stacktrace_entry/operator cmp | title=operator==<br>operator<=> | notes={{mark c++23}} | compares two {{tt|stacktrace_entry}} values}} | + | {{dsc fun|cpp/utility/stacktrace_entry/operator cmp|title=operator==<br>operator<=>|notes={{mark c++23}}|compares two {{tt|stacktrace_entry}} values}} |
− | {{dsc | + | {{dsc inc|cpp/utility/stacktrace_entry/dsc to_string}} |
− | {{dsc | + | {{dsc inc|cpp/utility/stacktrace_entry/dsc operator ltlt}} |
{{dsc end}} | {{dsc end}} | ||
===Helper classes=== | ===Helper classes=== | ||
{{dsc begin}} | {{dsc begin}} | ||
− | {{dsc | + | {{dsc inc|cpp/utility/stacktrace_entry/dsc hash}} |
+ | {{dsc inc|cpp/utility/stacktrace_entry/dsc formatter}} | ||
{{dsc end}} | {{dsc end}} | ||
+ | |||
+ | ===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. | ||
+ | {{feature test macro|__cpp_lib_stacktrace|std=C++23|value=202011L|[[cpp/error#Stacktrace|Stacktrace library]]}} | ||
===Example=== | ===Example=== | ||
Line 47: | Line 52: | ||
===See also=== | ===See also=== | ||
{{dsc begin}} | {{dsc begin}} | ||
− | {{dsc inc | cpp/utility/dsc basic_stacktrace}} | + | {{dsc inc|cpp/utility/dsc basic_stacktrace}} |
+ | {{dsc inc|cpp/utility/dsc source_location}} | ||
{{dsc end}} | {{dsc end}} | ||
{{langlinks|es|ja|ru|zh}} | {{langlinks|es|ja|ru|zh}} |
Latest revision as of 14:07, 30 October 2024
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 |
[edit] Member types
native_handle_type
|
implementation-defined native handle type |
[edit] Member functions
constructs a new stacktrace_entry (public member function) | |
(destructor) |
destroys the stacktrace_entry (public member function) |
assigns the contents of one stacktrace_entry to another (public member function) | |
Observers | |
gets the implementation-defined native handle of the stacktrace_entry (public member function) | |
checks whether the stacktrace_entry is empty (public member function) | |
Query | |
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) |
[edit] 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) |
[edit] Helper classes
hash support for std::stacktrace_entry (class template specialization) | |
formatting support for stacktrace_entry (class template specialization) |
[edit] 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 |
[edit] Example
This section is incomplete Reason: no example |
[edit] 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) |