std:: operator<< (std::basic_stacktrace)
From cppreference.net
<
cpp
|
utility
|
basic stacktrace
C++
Diagnostics library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::basic_stacktrace
|
Défini dans l'en-tête
<stacktrace>
|
||
|
template
<
class
Allocator
>
std:: ostream & operator << ( std:: ostream & os, const std:: basic_stacktrace < Allocator > & st ) ; |
(depuis C++23) | |
Insère la description de
st
dans le flux de sortie
os
. Équivalent à
return
os
<<
std::
to_string
(
st
)
;
.
Table des matières |
Paramètres
| os | - | un flux de sortie |
| st | - |
une
basic_stacktrace
dont la description doit être insérée
|
Valeur de retour
os
.
Exceptions
Peut lever des exceptions définies par l'implémentation.
Exemple
Exécuter ce code
Sortie possible :
The stacktrace obtained in the main function: 0# 0x0000000000402E7B in ./prog.exe 1# __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6 2# 0x0000000000402CD9 in ./prog.exe The stacktrace obtained in a nested lambda: 0# 0x0000000000402DDA in ./prog.exe 1# 0x0000000000402EB2 in ./prog.exe 2# __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6 3# 0x0000000000402CD9 in ./prog.exe
Voir aussi
|
(C++23)
|
effectue la sortie en flux de
stacktrace_entry
(fonction template) |