Namespaces
Variants
Actions

std::operator<<(std::stacktrace_entry)

From cppreference.com
 
C++
 
Diagnostics library
 
std::stacktrace_entry
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);.

Contents

[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

#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

[edit] See also

performs stream output of basic_stracktrace
(function template) [edit]

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant