[stacktrace.basic.obs]

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

## 19.6 Stacktrace [[stacktrace]](stacktrace#basic.obs)

### 19.6.4 Class template basic_stacktrace [[stacktrace.basic]](stacktrace.basic#obs)

#### 19.6.4.3 Observers [stacktrace.basic.obs]

[ð](#lib:const_iterator,basic_stacktrace)

`using const_iterator = implementation-defined;
`

[1](#1)

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

The type models[random_access_iterator](iterator.concept.random.access#concept:random_access_iterator "24.3.4.13 Concept random_­access_­iterator [iterator.concept.random.access]") ([[iterator.concept.random.access]](iterator.concept.random.access "24.3.4.13 Concept random_­access_­iterator")) and
meets the*Cpp17RandomAccessIterator* requirements ([[random.access.iterators]](random.access.iterators "24.3.5.7 Random access iterators"))[.](#1.sentence-1)

[ð](#lib:get_allocator,basic_stacktrace)

`allocator_type get_allocator() const noexcept;
`

[2](#2)

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

*Returns*: *frames_*.get_allocator()[.](#2.sentence-1)

[ð](#lib:begin,basic_stacktrace)

`const_iterator begin() const noexcept;
const_iterator cbegin() const noexcept;
`

[3](#3)

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

*Returns*: An iterator referring to the first element in *frames_*[.](#3.sentence-1)

If empty() is true,
then it returns the same value as end()[.](#3.sentence-2)

[ð](#lib:end,basic_stacktrace)

`const_iterator end() const noexcept;
const_iterator cend() const noexcept;
`

[4](#4)

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

*Returns*: The end iterator[.](#4.sentence-1)

[ð](#lib:rbegin,basic_stacktrace)

`const_reverse_iterator rbegin() const noexcept;
const_reverse_iterator crbegin() const noexcept;
`

[5](#5)

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

*Returns*: reverse_iterator(cend())[.](#5.sentence-1)

[ð](#lib:rend,basic_stacktrace)

`const_reverse_iterator rend() const noexcept;
const_reverse_iterator crend() const noexcept;
`

[6](#6)

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

*Returns*: reverse_iterator(cbegin())[.](#6.sentence-1)

[ð](#lib:empty,basic_stacktrace)

`bool empty() const noexcept;
`

[7](#7)

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

*Returns*: *frames_*.empty()[.](#7.sentence-1)

[ð](#lib:size,basic_stacktrace)

`size_type size() const noexcept;
`

[8](#8)

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

*Returns*: *frames_*.size()[.](#8.sentence-1)

[ð](#lib:max_size,basic_stacktrace)

`size_type max_size() const noexcept;
`

[9](#9)

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

*Returns*: *frames_*.max_size()[.](#9.sentence-1)

[ð](#lib:operator%5b%5d,basic_stacktrace)

`const_reference operator[](size_type frame_no) const;
`

[10](#10)

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

*Hardened preconditions*: frame_no < size() is true[.](#10.sentence-1)

[11](#11)

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

*Returns*: *frames_*[frame_no][.](#11.sentence-1)

[12](#12)

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

*Throws*: Nothing[.](#12.sentence-1)

[ð](#lib:at,basic_stacktrace)

`const_reference at(size_type frame_no) const;
`

[13](#13)

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

*Returns*: *frames_*[frame_no][.](#13.sentence-1)

[14](#14)

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

*Throws*: out_of_range if frame_no >= size()[.](#14.sentence-1)
