std::operator<<(std::stacktrace_entry)
From cppreference.com
< cpp | utility | stacktrace entry
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Diagnostics library
(until C++20*)
(C++17)(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
Exception handling failures
(C++11)
(until C++17*)
(until C++17*)
(until C++17*)
(until C++17*)
(TM TS)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++23)
(C++23)
(C++26)
(C++26)
(C++26)
std::stacktrace_entry
operator<<
Defined in header
<stacktrace>
std::ostream & operator<<( std::ostream & os, const std::stacktrace_entry & f );
(since C++23)
Inserts the description of f into the output stream os. Equivalent to return os << std::to_string (f);.
[edit] Parameters
os
-
an output stream
f
-
a
stacktrace_entry
whose description is to be inserted
[edit] Return value
os
[edit] Exceptions
May throw implementation-defined exceptions.
[edit] Example
Run this code
#include <iostream> #include <stacktrace> int main() { for (const auto& f : std::stacktrace::current()) std::cout << f << '\n'; }
Possible output:
0x0000000000402AA7 in ./prog.exe __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6 0x00000000004029B9 in ./prog.exe