|
|
Member functions | ||||
Iterators | ||||
basic_stacktrace::endbasic_stacktrace::cend | ||||
Capacity | ||||
Element access | ||||
Modifiers | ||||
Non-member functions | ||||
Helper classes | ||||
const_iterator end() constnoexcept; | (1) | (since C++23) |
const_iterator cend()constnoexcept; | (2) | (since C++23) |
Returns the iterator pointing past the last entry of thebasic_stacktrace
.
This iterator acts as a placeholder; attempting to dereference it results in undefined behavior.
Contents |
(none)
The end iterator.
Constant.
#include <algorithm>#include <iostream>#include <stacktrace> int main(){auto trace= std::stacktrace::current();auto empty_trace=std::stacktrace{}; // Print stacktrace.std::for_each(trace.begin(), trace.end(),[](constauto& f){std::cout<< f<<'\n';}); if(empty_trace.begin()== empty_trace.end())std::cout<<"stacktrace 'empty_trace' is indeed empty.\n";}
Possible output:
0x0000000000402BA8 in ./prog.exe__libc_start_main in /lib/x86_64-linux-gnu/libc.so.60x0000000000402A29 in ./prog.exestacktrace 'empty_trace' is indeed empty.
returns an iterator to the beginning (public member function)[edit] |