|
|
size_type size()constnoexcept; | (since C++23) | |
Returns the number of entries in the stacktrace.
Contents |
(none)
The number of entries in the stacktrace.
Constant.
The following code usessize
to display the number of entries in the current stacktrace:
#include <stacktrace>#include <iostream> int main(){auto trace= std::stacktrace::current(); std::cout<<"trace contains "<< trace.size()<<" entries.\n";}
Possible output:
trace contains 3 entries.
checks whether thebasic_stacktrace is empty(public member function)[edit] | |
returns the maximum possible number of stacktrace entries (public member function)[edit] |