std::operator<<(std::stacktrace_entry)
來自 cppreference.com
定義於標頭檔案 <stacktrace> |
||
std::ostream& operator<<( std::ostream& os, const std::stacktrace_entry& f ); |
(C++23 起) | |
將 f 的描述插入到輸出流 os 中。等價於 return os << std::to_string(f);。
目錄 |
[編輯] 引數
os | - | 一個輸出流 |
f | - | 一個要插入其描述的 stacktrace_entry |
[編輯] 返回值
os
[編輯] 異常
可能丟擲實現定義的異常。
[編輯] 示例
執行此程式碼
#include <iostream> #include <stacktrace> int main() { for (const auto& f : std::stacktrace::current()) std::cout << f << '\n'; }
可能的輸出
0x0000000000402AA7 in ./prog.exe __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6 0x00000000004029B9 in ./prog.exe
[編輯] 參閱
(C++23) |
執行 basic_stacktrace 的流輸出(函式模板) |