- stacktrace[meta header]
- std[meta namespace]
- basic_stacktrace[meta class]
- function[meta id-type]
- cpp23[meta cpp]
namespace std {
template <class Allocator>
ostream& operator<<(ostream& os, const basic_stacktrace<Allocator>& st);
}出力ストリームに出力する。
以下と等価:
return os << to_string(st);- to_string[link to_string.md]
#include <iostream>
#include <stacktrace>
void g() {
std::cout << std::stacktrace::current() << std::endl;
}
void f() {
g();
}
int main() {
f();
}- current()[link current.md]
0# g() at /app/example.cpp:5
1# f() at /app/example.cpp:9
2# main at /app/example.cpp:13
3# at :0
4# at :0
5# _start at :0
6#
- C++23
- Clang: ??
- GCC: 12 [mark verified]
- Visual C++: ??
- LWG Issue 3515.
[stacktrace.basic.nonmem]:operator<<should be less templatized- C++23で、
operator<<がcharT/traitsでテンプレート化されたbasic_ostream<charT, traits>ではなく、非テンプレートのostreamを受け取り返すよう変更された
- C++23で、