From Jason Turner

[stacktrace]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp0prulzxk/{from.md → to.md} +617 -0
tmp/tmp0prulzxk/{from.md → to.md} RENAMED
@@ -0,0 +1,617 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Stacktrace <a id="stacktrace">[[stacktrace]]</a>
2
+
3
+ ### General <a id="stacktrace.general">[[stacktrace.general]]</a>
4
+
5
+ Subclause [[stacktrace]] describes components that C++ programs may use
6
+ to store the stacktrace of the current thread of execution and query
7
+ information about the stored stacktrace at runtime.
8
+
9
+ The *invocation sequence* of the current evaluation x₀ in the current
10
+ thread of execution is a sequence (x₀, …, xₙ) of evaluations such that,
11
+ for i ≥ 0, xᵢ is within the function invocation xᵢ₊₁
12
+ [[intro.execution]].
13
+
14
+ A *stacktrace* is an approximate representation of an invocation
15
+ sequence and consists of stacktrace entries. A *stacktrace entry*
16
+ represents an evaluation in a stacktrace.
17
+
18
+ ### Header `<stacktrace>` synopsis <a id="stacktrace.syn">[[stacktrace.syn]]</a>
19
+
20
+ ``` cpp
21
+ #include <compare> // see [compare.syn]
22
+
23
+ namespace std {
24
+ // [stacktrace.entry], class stacktrace_entry
25
+ class stacktrace_entry;
26
+
27
+ // [stacktrace.basic], class template basic_stacktrace
28
+ template<class Allocator>
29
+ class basic_stacktrace;
30
+
31
+ // basic_stacktrace typedef-names
32
+ using stacktrace = basic_stacktrace<allocator<stacktrace_entry>>;
33
+
34
+ // [stacktrace.basic.nonmem], non-member functions
35
+ template<class Allocator>
36
+ void swap(basic_stacktrace<Allocator>& a, basic_stacktrace<Allocator>& b)
37
+ noexcept(noexcept(a.swap(b)));
38
+
39
+ string to_string(const stacktrace_entry& f);
40
+
41
+ template<class Allocator>
42
+ string to_string(const basic_stacktrace<Allocator>& st);
43
+
44
+ ostream& operator<<(ostream& os, const stacktrace_entry& f);
45
+ template<class Allocator>
46
+ ostream& operator<<(ostream& os, const basic_stacktrace<Allocator>& st);
47
+
48
+ // [stacktrace.format], formatting support
49
+ template<> struct formatter<stacktrace_entry>;
50
+ template<class Allocator> struct formatter<basic_stacktrace<Allocator>>;
51
+
52
+ namespace pmr {
53
+ using stacktrace = basic_stacktrace<polymorphic_allocator<stacktrace_entry>>;
54
+ }
55
+
56
+ // [stacktrace.basic.hash], hash support
57
+ template<class T> struct hash;
58
+ template<> struct hash<stacktrace_entry>;
59
+ template<class Allocator> struct hash<basic_stacktrace<Allocator>>;
60
+ }
61
+ ```
62
+
63
+ ### Class `stacktrace_entry` <a id="stacktrace.entry">[[stacktrace.entry]]</a>
64
+
65
+ #### Overview <a id="stacktrace.entry.overview">[[stacktrace.entry.overview]]</a>
66
+
67
+ ``` cpp
68
+ namespace std {
69
+ class stacktrace_entry {
70
+ public:
71
+ using native_handle_type = implementation-defined // stacktrace_entry::native_handle_type;
72
+
73
+ // [stacktrace.entry.cons], constructors
74
+ constexpr stacktrace_entry() noexcept;
75
+ constexpr stacktrace_entry(const stacktrace_entry& other) noexcept;
76
+ constexpr stacktrace_entry& operator=(const stacktrace_entry& other) noexcept;
77
+
78
+ ~stacktrace_entry();
79
+
80
+ // [stacktrace.entry.obs], observers
81
+ constexpr native_handle_type native_handle() const noexcept;
82
+ constexpr explicit operator bool() const noexcept;
83
+
84
+ // [stacktrace.entry.query], query
85
+ string description() const;
86
+ string source_file() const;
87
+ uint_least32_t source_line() const;
88
+
89
+ // [stacktrace.entry.cmp], comparison
90
+ friend constexpr bool operator==(const stacktrace_entry& x,
91
+ const stacktrace_entry& y) noexcept;
92
+ friend constexpr strong_ordering operator<=>(const stacktrace_entry& x,
93
+ const stacktrace_entry& y) noexcept;
94
+ };
95
+ }
96
+ ```
97
+
98
+ An object of type `stacktrace_entry` is either empty, or represents a
99
+ stacktrace entry and provides operations for querying information about
100
+ it. The class `stacktrace_entry` models `regular` [[concepts.object]]
101
+ and `three_way_comparable<strong_ordering>` [[cmp.concept]].
102
+
103
+ #### Constructors <a id="stacktrace.entry.cons">[[stacktrace.entry.cons]]</a>
104
+
105
+ ``` cpp
106
+ constexpr stacktrace_entry() noexcept;
107
+ ```
108
+
109
+ *Ensures:* `*this` is empty.
110
+
111
+ #### Observers <a id="stacktrace.entry.obs">[[stacktrace.entry.obs]]</a>
112
+
113
+ ``` cpp
114
+ constexpr native_handle_type native_handle() const noexcept;
115
+ ```
116
+
117
+ The semantics of this function are *implementation-defined*.
118
+
119
+ *Remarks:* Successive invocations of the `native_handle` function for an
120
+ unchanged `stacktrace_entry` object return identical values.
121
+
122
+ ``` cpp
123
+ constexpr explicit operator bool() const noexcept;
124
+ ```
125
+
126
+ *Returns:* `false` if and only if `*this` is empty.
127
+
128
+ #### Query <a id="stacktrace.entry.query">[[stacktrace.entry.query]]</a>
129
+
130
+ [*Note 1*: All the `stacktrace_entry` query functions treat errors
131
+ other than memory allocation errors as “no information available” and do
132
+ not throw in that case. — *end note*]
133
+
134
+ ``` cpp
135
+ string description() const;
136
+ ```
137
+
138
+ *Returns:* A description of the evaluation represented by `*this`, or an
139
+ empty string.
140
+
141
+ *Throws:* `bad_alloc` if memory for the internal data structures or the
142
+ resulting string cannot be allocated.
143
+
144
+ ``` cpp
145
+ string source_file() const;
146
+ ```
147
+
148
+ *Returns:* The presumed or actual name of the source
149
+ file [[cpp.predefined]] that lexically contains the expression or
150
+ statement whose evaluation is represented by `*this`, or an empty
151
+ string.
152
+
153
+ *Throws:* `bad_alloc` if memory for the internal data structures or the
154
+ resulting string cannot be allocated.
155
+
156
+ ``` cpp
157
+ uint_least32_t source_line() const;
158
+ ```
159
+
160
+ *Returns:* `0`, or a 1-based line number that lexically relates to the
161
+ evaluation represented by `*this`. If `source_file` returns the presumed
162
+ name of the source file, returns the presumed line number; if
163
+ `source_file` returns the actual name of the source file, returns the
164
+ actual line number.
165
+
166
+ *Throws:* `bad_alloc` if memory for the internal data structures cannot
167
+ be allocated.
168
+
169
+ #### Comparison <a id="stacktrace.entry.cmp">[[stacktrace.entry.cmp]]</a>
170
+
171
+ ``` cpp
172
+ friend constexpr bool operator==(const stacktrace_entry& x, const stacktrace_entry& y) noexcept;
173
+ ```
174
+
175
+ *Returns:* `true` if and only if `x` and `y` represent the same
176
+ stacktrace entry or both `x` and `y` are empty.
177
+
178
+ ### Class template `basic_stacktrace` <a id="stacktrace.basic">[[stacktrace.basic]]</a>
179
+
180
+ #### Overview <a id="stacktrace.basic.overview">[[stacktrace.basic.overview]]</a>
181
+
182
+ ``` cpp
183
+ namespace std {
184
+ template<class Allocator>
185
+ class basic_stacktrace {
186
+ public:
187
+ using value_type = stacktrace_entry;
188
+ using const_reference = const value_type&;
189
+ using reference = value_type&;
190
+ using const_iterator = implementation-defined // type of basic_stacktrace::const_iterator; // see [stacktrace.basic.obs]
191
+ using iterator = const_iterator;
192
+ using reverse_iterator = std::reverse_iterator<iterator>;
193
+ using const_reverse_iterator = std::reverse_iterator<const_iterator>;
194
+ using difference_type = implementation-defined // type of basic_stacktrace::difference_type;
195
+ using size_type = implementation-defined // type of basic_stacktrace::size_type;
196
+ using allocator_type = Allocator;
197
+
198
+ // [stacktrace.basic.cons], creation and assignment
199
+ static basic_stacktrace current(const allocator_type& alloc = allocator_type()) noexcept;
200
+ static basic_stacktrace current(size_type skip,
201
+ const allocator_type& alloc = allocator_type()) noexcept;
202
+ static basic_stacktrace current(size_type skip, size_type max_depth,
203
+ const allocator_type& alloc = allocator_type()) noexcept;
204
+
205
+ basic_stacktrace() noexcept(is_nothrow_default_constructible_v<allocator_type>);
206
+ explicit basic_stacktrace(const allocator_type& alloc) noexcept;
207
+
208
+ basic_stacktrace(const basic_stacktrace& other);
209
+ basic_stacktrace(basic_stacktrace&& other) noexcept;
210
+ basic_stacktrace(const basic_stacktrace& other, const allocator_type& alloc);
211
+ basic_stacktrace(basic_stacktrace&& other, const allocator_type& alloc);
212
+ basic_stacktrace& operator=(const basic_stacktrace& other);
213
+ basic_stacktrace& operator=(basic_stacktrace&& other)
214
+ noexcept(allocator_traits<Allocator>::propagate_on_container_move_assignment::value ||
215
+ allocator_traits<Allocator>::is_always_equal::value);
216
+
217
+ ~basic_stacktrace();
218
+
219
+ // [stacktrace.basic.obs], observers
220
+ allocator_type get_allocator() const noexcept;
221
+
222
+ const_iterator begin() const noexcept;
223
+ const_iterator end() const noexcept;
224
+ const_reverse_iterator rbegin() const noexcept;
225
+ const_reverse_iterator rend() const noexcept;
226
+
227
+ const_iterator cbegin() const noexcept;
228
+ const_iterator cend() const noexcept;
229
+ const_reverse_iterator crbegin() const noexcept;
230
+ const_reverse_iterator crend() const noexcept;
231
+
232
+ [[nodiscard]] bool empty() const noexcept;
233
+ size_type size() const noexcept;
234
+ size_type max_size() const noexcept;
235
+
236
+ const_reference operator[](size_type) const;
237
+ const_reference at(size_type) const;
238
+
239
+ // [stacktrace.basic.cmp], comparisons
240
+ template<class Allocator2>
241
+ friend bool operator==(const basic_stacktrace& x,
242
+ const basic_stacktrace<Allocator2>& y) noexcept;
243
+ template<class Allocator2>
244
+ friend strong_ordering operator<=>(const basic_stacktrace& x,
245
+ const basic_stacktrace<Allocator2>& y) noexcept;
246
+
247
+ // [stacktrace.basic.mod], modifiers
248
+ void swap(basic_stacktrace& other)
249
+ noexcept(allocator_traits<Allocator>::propagate_on_container_swap::value ||
250
+ allocator_traits<Allocator>::is_always_equal::value);
251
+
252
+ private:
253
+ vector<value_type, allocator_type> frames_; // exposition only
254
+ };
255
+ }
256
+ ```
257
+
258
+ The class template `basic_stacktrace` satisfies the requirements of a
259
+ reversible container [[container.rev.reqmts]], of an allocator-aware
260
+ container [[container.alloc.reqmts]], and of a sequence container
261
+ [[sequence.reqmts]], except that
262
+
263
+ - only move, assignment, swap, and operations defined for
264
+ const-qualified sequence containers are supported and,
265
+ - the semantics of comparison functions are different from those
266
+ required for a container.
267
+
268
+ #### Creation and assignment <a id="stacktrace.basic.cons">[[stacktrace.basic.cons]]</a>
269
+
270
+ ``` cpp
271
+ static basic_stacktrace current(const allocator_type& alloc = allocator_type()) noexcept;
272
+ ```
273
+
274
+ *Returns:* A `basic_stacktrace` object with `frames_` storing the
275
+ stacktrace of the current evaluation in the current thread of execution,
276
+ or an empty `basic_stacktrace` object if the initialization of `frames_`
277
+ failed. `alloc` is passed to the constructor of the `frames_` object.
278
+
279
+ [*Note 1*: If the stacktrace was successfully obtained, then
280
+ `frames_.front()` is the `stacktrace_entry` representing approximately
281
+ the current evaluation, and `frames_.back()` is the `stacktrace_entry`
282
+ representing approximately the initial function of the current thread of
283
+ execution. — *end note*]
284
+
285
+ ``` cpp
286
+ static basic_stacktrace current(size_type skip,
287
+ const allocator_type& alloc = allocator_type()) noexcept;
288
+ ```
289
+
290
+ Let `t` be a stacktrace as-if obtained via
291
+ `basic_stacktrace::current(alloc)`. Let `n` be `t.size()`.
292
+
293
+ *Returns:* A `basic_stacktrace` object where `frames_` is
294
+ direct-non-list-initialized from arguments `t.begin() + min(n, skip)`,
295
+ `t.end()`, and `alloc`, or an empty `basic_stacktrace` object if the
296
+ initialization of `frames_` failed.
297
+
298
+ ``` cpp
299
+ static basic_stacktrace current(size_type skip, size_type max_depth,
300
+ const allocator_type& alloc = allocator_type()) noexcept;
301
+ ```
302
+
303
+ Let `t` be a stacktrace as-if obtained via
304
+ `basic_stacktrace::current(alloc)`. Let `n` be `t.size()`.
305
+
306
+ *Preconditions:* `skip <= skip + max_depth` is `true`.
307
+
308
+ *Returns:* A `basic_stacktrace` object where `frames_` is
309
+ direct-non-list-initialized from arguments `t.begin() + min(n, skip)`,
310
+ `t.begin() + min(n, skip + max_depth)`, and `alloc`, or an empty
311
+ `basic_stacktrace` object if the initialization of `frames_` failed.
312
+
313
+ ``` cpp
314
+ basic_stacktrace() noexcept(is_nothrow_default_constructible_v<allocator_type>);
315
+ ```
316
+
317
+ *Ensures:* `empty()` is `true`.
318
+
319
+ ``` cpp
320
+ explicit basic_stacktrace(const allocator_type& alloc) noexcept;
321
+ ```
322
+
323
+ *Effects:* `alloc` is passed to the `frames_` constructor.
324
+
325
+ *Ensures:* `empty()` is `true`.
326
+
327
+ ``` cpp
328
+ basic_stacktrace(const basic_stacktrace& other);
329
+ basic_stacktrace(const basic_stacktrace& other, const allocator_type& alloc);
330
+ basic_stacktrace(basic_stacktrace&& other, const allocator_type& alloc);
331
+ basic_stacktrace& operator=(const basic_stacktrace& other);
332
+ basic_stacktrace& operator=(basic_stacktrace&& other)
333
+ noexcept(allocator_traits<Allocator>::propagate_on_container_move_assignment::value ||
334
+ allocator_traits<Allocator>::is_always_equal::value);
335
+ ```
336
+
337
+ *Remarks:* Implementations may strengthen the exception specification
338
+ for these functions [[res.on.exception.handling]] by ensuring that
339
+ `empty()` is `true` on failed allocation.
340
+
341
+ #### Observers <a id="stacktrace.basic.obs">[[stacktrace.basic.obs]]</a>
342
+
343
+ ``` cpp
344
+ using const_iterator = implementation-defined;
345
+ ```
346
+
347
+ The type models `random_access_iterator`
348
+ [[iterator.concept.random.access]] and meets the
349
+ *Cpp17RandomAccessIterator* requirements [[random.access.iterators]].
350
+
351
+ ``` cpp
352
+ allocator_type get_allocator() const noexcept;
353
+ ```
354
+
355
+ *Returns:* `frames_.get_allocator()`.
356
+
357
+ ``` cpp
358
+ const_iterator begin() const noexcept;
359
+ const_iterator cbegin() const noexcept;
360
+ ```
361
+
362
+ *Returns:* An iterator referring to the first element in `frames_`. If
363
+ `empty()` is `true`, then it returns the same value as `end()`.
364
+
365
+ ``` cpp
366
+ const_iterator end() const noexcept;
367
+ const_iterator cend() const noexcept;
368
+ ```
369
+
370
+ *Returns:* The end iterator.
371
+
372
+ ``` cpp
373
+ const_reverse_iterator rbegin() const noexcept;
374
+ const_reverse_iterator crbegin() const noexcept;
375
+ ```
376
+
377
+ *Returns:* `reverse_iterator(cend())`.
378
+
379
+ ``` cpp
380
+ const_reverse_iterator rend() const noexcept;
381
+ const_reverse_iterator crend() const noexcept;
382
+ ```
383
+
384
+ *Returns:* `reverse_iterator(cbegin())`.
385
+
386
+ ``` cpp
387
+ [[nodiscard]] bool empty() const noexcept;
388
+ ```
389
+
390
+ *Returns:* `frames_.empty()`.
391
+
392
+ ``` cpp
393
+ size_type size() const noexcept;
394
+ ```
395
+
396
+ *Returns:* `frames_.size()`.
397
+
398
+ ``` cpp
399
+ size_type max_size() const noexcept;
400
+ ```
401
+
402
+ *Returns:* `frames_.max_size()`.
403
+
404
+ ``` cpp
405
+ const_reference operator[](size_type frame_no) const;
406
+ ```
407
+
408
+ *Preconditions:* `frame_no < size()` is `true`.
409
+
410
+ *Returns:* `frames_[frame_no]`.
411
+
412
+ *Throws:* Nothing.
413
+
414
+ ``` cpp
415
+ const_reference at(size_type frame_no) const;
416
+ ```
417
+
418
+ *Returns:* `frames_[frame_no]`.
419
+
420
+ *Throws:* `out_of_range` if `frame_no >= size()`.
421
+
422
+ #### Comparisons <a id="stacktrace.basic.cmp">[[stacktrace.basic.cmp]]</a>
423
+
424
+ ``` cpp
425
+ template<class Allocator2>
426
+ friend bool operator==(const basic_stacktrace& x, const basic_stacktrace<Allocator2>& y) noexcept;
427
+ ```
428
+
429
+ *Returns:* `equal(x.begin(), x.end(), y.begin(), y.end())`.
430
+
431
+ ``` cpp
432
+ template<class Allocator2>
433
+ friend strong_ordering
434
+ operator<=>(const basic_stacktrace& x, const basic_stacktrace<Allocator2>& y) noexcept;
435
+ ```
436
+
437
+ *Returns:* `x.size() <=> y.size()` if `x.size() != y.size()`;
438
+ `lexicographical_compare_three_way(x.begin(), x.end(), y.begin(), y.end())`
439
+ otherwise.
440
+
441
+ #### Modifiers <a id="stacktrace.basic.mod">[[stacktrace.basic.mod]]</a>
442
+
443
+ ``` cpp
444
+ void swap(basic_stacktrace& other)
445
+ noexcept(allocator_traits<Allocator>::propagate_on_container_swap::value ||
446
+ allocator_traits<Allocator>::is_always_equal::value);
447
+ ```
448
+
449
+ *Effects:* Exchanges the contents of `*this` and `other`.
450
+
451
+ #### Non-member functions <a id="stacktrace.basic.nonmem">[[stacktrace.basic.nonmem]]</a>
452
+
453
+ ``` cpp
454
+ template<class Allocator>
455
+ void swap(basic_stacktrace<Allocator>& a, basic_stacktrace<Allocator>& b)
456
+ noexcept(noexcept(a.swap(b)));
457
+ ```
458
+
459
+ *Effects:* Equivalent to `a.swap(b)`.
460
+
461
+ ``` cpp
462
+ string to_string(const stacktrace_entry& f);
463
+ ```
464
+
465
+ *Returns:* A string with a description of `f`.
466
+
467
+ *Recommended practice:* The description should provide information about
468
+ the contained evaluation, including information from `f.source_file()`
469
+ and `f.source_line()`.
470
+
471
+ ``` cpp
472
+ template<class Allocator>
473
+ string to_string(const basic_stacktrace<Allocator>& st);
474
+ ```
475
+
476
+ *Returns:* A string with a description of `st`.
477
+
478
+ [*Note 1*: The number of lines is not guaranteed to be equal to
479
+ `st.size()`. — *end note*]
480
+
481
+ ``` cpp
482
+ ostream& operator<<(ostream& os, const stacktrace_entry& f);
483
+ ```
484
+
485
+ *Effects:* Equivalent to: `return os << to_string(f);`
486
+
487
+ ``` cpp
488
+ template<class Allocator>
489
+ ostream& operator<<(ostream& os, const basic_stacktrace<Allocator>& st);
490
+ ```
491
+
492
+ *Effects:* Equivalent to: `return os << to_string(st);`
493
+
494
+ #### Formatting support <a id="stacktrace.format">[[stacktrace.format]]</a>
495
+
496
+ ``` cpp
497
+ template<> struct formatter<stacktrace_entry>;
498
+ ```
499
+
500
+ `formatter<stacktrace_entry>` interprets *format-spec* as a
501
+ *stacktrace-entry-format-spec*. The syntax of format specifications is
502
+ as follows:
503
+
504
+ ``` bnf
505
+ stacktrace-entry-format-spec
506
+ fill-and-alignₒₚₜ widthₒₚₜ
507
+ ```
508
+
509
+ [*Note 1*: The productions *fill-and-align* and *width* are described
510
+ in [[format.string.std]]. — *end note*]
511
+
512
+ A `stacktrace_entry` object `se` is formatted as if by copying
513
+ `to_string(se)` through the output iterator of the context with
514
+ additional padding and adjustments as specified by the format
515
+ specifiers.
516
+
517
+ ``` cpp
518
+ template<class Allocator> struct formatter<basic_stacktrace<Allocator>>;
519
+ ```
520
+
521
+ For `formatter<basic_stacktrace<Allocator>>`, *format-spec* is empty.
522
+
523
+ A `basic_stacktrace<Allocator>` object `s` is formatted as if by copying
524
+ `to_string(s)` through the output iterator of the context.
525
+
526
+ #### Hash support <a id="stacktrace.basic.hash">[[stacktrace.basic.hash]]</a>
527
+
528
+ ``` cpp
529
+ template<> struct hash<stacktrace_entry>;
530
+ template<class Allocator> struct hash<basic_stacktrace<Allocator>>;
531
+ ```
532
+
533
+ The specializations are enabled [[unord.hash]].
534
+
535
+ <!-- Link reference definitions -->
536
+ [assertions]: #assertions
537
+ [assertions.assert]: #assertions.assert
538
+ [assertions.general]: #assertions.general
539
+ [bad.alloc]: support.md#bad.alloc
540
+ [cassert.syn]: #cassert.syn
541
+ [cerrno.syn]: #cerrno.syn
542
+ [cmp.concept]: support.md#cmp.concept
543
+ [comparisons.three.way]: utilities.md#comparisons.three.way
544
+ [concepts.object]: concepts.md#concepts.object
545
+ [container.alloc.reqmts]: containers.md#container.alloc.reqmts
546
+ [container.rev.reqmts]: containers.md#container.rev.reqmts
547
+ [conv]: expr.md#conv
548
+ [cpp.predefined]: cpp.md#cpp.predefined
549
+ [defns.const.subexpr]: intro.md#defns.const.subexpr
550
+ [diagnostics]: #diagnostics
551
+ [diagnostics.general]: #diagnostics.general
552
+ [diagnostics.summary]: #diagnostics.summary
553
+ [domain.error]: #domain.error
554
+ [errno]: #errno
555
+ [errno.general]: #errno.general
556
+ [format.string.std]: utilities.md#format.string.std
557
+ [intro.execution]: basic.md#intro.execution
558
+ [invalid.argument]: #invalid.argument
559
+ [iterator.concept.random.access]: iterators.md#iterator.concept.random.access
560
+ [length.error]: #length.error
561
+ [logic.error]: #logic.error
562
+ [out.of.range]: #out.of.range
563
+ [overflow.error]: #overflow.error
564
+ [random.access.iterators]: iterators.md#random.access.iterators
565
+ [range.error]: #range.error
566
+ [res.on.exception.handling]: library.md#res.on.exception.handling
567
+ [runtime.error]: #runtime.error
568
+ [sequence.reqmts]: containers.md#sequence.reqmts
569
+ [stacktrace]: #stacktrace
570
+ [stacktrace.basic]: #stacktrace.basic
571
+ [stacktrace.basic.cmp]: #stacktrace.basic.cmp
572
+ [stacktrace.basic.cons]: #stacktrace.basic.cons
573
+ [stacktrace.basic.hash]: #stacktrace.basic.hash
574
+ [stacktrace.basic.mod]: #stacktrace.basic.mod
575
+ [stacktrace.basic.nonmem]: #stacktrace.basic.nonmem
576
+ [stacktrace.basic.obs]: #stacktrace.basic.obs
577
+ [stacktrace.basic.overview]: #stacktrace.basic.overview
578
+ [stacktrace.entry]: #stacktrace.entry
579
+ [stacktrace.entry.cmp]: #stacktrace.entry.cmp
580
+ [stacktrace.entry.cons]: #stacktrace.entry.cons
581
+ [stacktrace.entry.obs]: #stacktrace.entry.obs
582
+ [stacktrace.entry.overview]: #stacktrace.entry.overview
583
+ [stacktrace.entry.query]: #stacktrace.entry.query
584
+ [stacktrace.format]: #stacktrace.format
585
+ [stacktrace.general]: #stacktrace.general
586
+ [stacktrace.syn]: #stacktrace.syn
587
+ [std.exceptions]: #std.exceptions
588
+ [std.exceptions.general]: #std.exceptions.general
589
+ [stdexcept.syn]: #stdexcept.syn
590
+ [syserr]: #syserr
591
+ [syserr.compare]: #syserr.compare
592
+ [syserr.errcat]: #syserr.errcat
593
+ [syserr.errcat.derived]: #syserr.errcat.derived
594
+ [syserr.errcat.nonvirtuals]: #syserr.errcat.nonvirtuals
595
+ [syserr.errcat.objects]: #syserr.errcat.objects
596
+ [syserr.errcat.overview]: #syserr.errcat.overview
597
+ [syserr.errcat.virtuals]: #syserr.errcat.virtuals
598
+ [syserr.errcode]: #syserr.errcode
599
+ [syserr.errcode.constructors]: #syserr.errcode.constructors
600
+ [syserr.errcode.modifiers]: #syserr.errcode.modifiers
601
+ [syserr.errcode.nonmembers]: #syserr.errcode.nonmembers
602
+ [syserr.errcode.observers]: #syserr.errcode.observers
603
+ [syserr.errcode.overview]: #syserr.errcode.overview
604
+ [syserr.errcondition]: #syserr.errcondition
605
+ [syserr.errcondition.constructors]: #syserr.errcondition.constructors
606
+ [syserr.errcondition.modifiers]: #syserr.errcondition.modifiers
607
+ [syserr.errcondition.nonmembers]: #syserr.errcondition.nonmembers
608
+ [syserr.errcondition.observers]: #syserr.errcondition.observers
609
+ [syserr.errcondition.overview]: #syserr.errcondition.overview
610
+ [syserr.general]: #syserr.general
611
+ [syserr.hash]: #syserr.hash
612
+ [syserr.syserr]: #syserr.syserr
613
+ [syserr.syserr.members]: #syserr.syserr.members
614
+ [syserr.syserr.overview]: #syserr.syserr.overview
615
+ [system.error.syn]: #system.error.syn
616
+ [underflow.error]: #underflow.error
617
+ [unord.hash]: utilities.md#unord.hash