[stacktrace.format]

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

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

### 19.6.5 Formatting support [stacktrace.format]

[ð](#itemdecl:1)

`template<> struct formatter<stacktrace_entry>;
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L2362)

formatter<stacktrace_entry> interprets *format-spec* as a *stacktrace-entry-format-spec*[.](#1.sentence-1)

The syntax of format specifications is as follows:

stacktrace-entry-format-spec :  
fill-and-alignopt widthopt

[*Note [1](#note-1)*:

The productions *fill-and-align* and *width* are described in [[format.string.std]](format.string.std "28.5.2.2 Standard format specifiers")[.](#1.sentence-3)

â *end note*]

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L2377)

A stacktrace_entry object se is formatted as if by
copying to_string(se) through the output iterator of the context
with additional padding and adjustments as specified by the format specifiers[.](#2.sentence-1)

[ð](#itemdecl:2)

`template<class Allocator> struct formatter<basic_stacktrace<Allocator>>;
`

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L2388)

For formatter<basic_stacktrace<Allocator>>,*format-spec* is empty[.](#3.sentence-1)

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L2392)

A basic_stacktrace<Allocator> object s is formatted as if by
copying to_string(s) through the output iterator of the context[.](#4.sentence-1)
