[stacktrace.syn]

# 19 Diagnostics library [[diagnostics]](./#diagnostics)

## 19.6 Stacktrace [[stacktrace]](stacktrace#syn)

### 19.6.2 Header <stacktrace> synopsis [stacktrace.syn]

[ð](#header:%3cstacktrace%3e)

#include <compare> // see [[compare.syn]](compare.syn "17.12.1 Header <compare> synopsis")namespace std {// [[stacktrace.entry]](stacktrace.entry "19.6.3 Class stacktrace_­entry"), class stacktrace_entryclass stacktrace_entry; // [[stacktrace.basic]](stacktrace.basic "19.6.4 Class template basic_­stacktrace"), class template basic_stacktracetemplate<class Allocator>class basic_stacktrace; // basic_stacktrace [*typedef-name*](dcl.typedef#nt:typedef-name "9.2.4 The typedef specifier [dcl.typedef]")*s*using stacktrace = basic_stacktrace<allocator<stacktrace_entry>>; // [[stacktrace.basic.nonmem]](stacktrace.basic.nonmem "19.6.4.6 Non-member functions"), non-member functionstemplate<class Allocator>void swap(basic_stacktrace<Allocator>& a, basic_stacktrace<Allocator>& b)noexcept(noexcept(a.swap(b)));

 string to_string(const stacktrace_entry& f); template<class Allocator> string to_string(const basic_stacktrace<Allocator>& st);

 ostream& operator<<(ostream& os, const stacktrace_entry& f); template<class Allocator> ostream& operator<<(ostream& os, const basic_stacktrace<Allocator>& st); // [[stacktrace.format]](stacktrace.format "19.6.5 Formatting support"), formatting supporttemplate<> struct formatter<stacktrace_entry>; template<class Allocator> struct formatter<basic_stacktrace<Allocator>>; namespace pmr {using stacktrace = basic_stacktrace<polymorphic_allocator<stacktrace_entry>>; }// [[stacktrace.basic.hash]](stacktrace.basic.hash "19.6.6 Hash support"), hash supporttemplate<class T> struct hash; template<> struct hash<stacktrace_entry>; template<class Allocator> struct hash<basic_stacktrace<Allocator>>;}
