std::operator<<(std::basic_stacktrace)
Min standard notice:
Header: <stacktrace>
Inserts the description of st into the output stream os. Equivalent to return os « std::to_string(st);.
# Declarations
template< class Allocator >
std::ostream& operator<<( std::ostream& os, const std::basic_stacktrace<Allocator>& st );
(since C++23)
# Parameters
os: an output streamst: a basic_stacktrace whose description is to be inserted
# Return value
os.
# Example
#include <stacktrace>
#include <iostream>
int main()
{
std::cout << "The stacktrace obtained in the main function:\n";
std::cout << std::stacktrace::current() << '\n';
[]{
std::cout << "The stacktrace obtained in a nested lambda:\n";
std::cout << std::stacktrace::current() << '\n';
}();
}