Namespaces
Variants

std::basic_stacktrace<Allocator>:: end, std::basic_stacktrace<Allocator>:: cend

From cppreference.net
const_iterator end ( ) const noexcept ;
(1) (C++23 이후)
const_iterator cend ( ) const noexcept ;
(2) (C++23 이후)

basic_stacktrace 의 마지막 항목 이후를 가리키는 반복자를 반환합니다.

이 반복자는 플레이스홀더 역할을 합니다; 이를 역참조하려고 시도하면 정의되지 않은 동작이 발생합니다.

range-begin-end.svg

목차

매개변수

(없음)

반환값

끝 반복자.

복잡도

상수.

예제

#include <algorithm>
#include <iostream>
#include <stacktrace>
int main()
{
    auto trace       = std::stacktrace::current();
    auto empty_trace = std::stacktrace{};
    // 스택 트레이스 출력
    std::for_each(trace.begin(), trace.end(),
                  [](const auto& f) { std::cout << f << '\n'; });
    if (empty_trace.begin() == empty_trace.end())
        std::cout << "스택 트레이스 'empty_trace'는 실제로 비어 있습니다.\n";
}

가능한 출력:

0x0000000000402BA8 in ./prog.exe
__libc_start_main in /lib/x86_64-linux-gnu/libc.so.6
0x0000000000402A29 in ./prog.exe
stacktrace 'empty_trace' is indeed empty.

참고 항목

시작 부분에 대한 반복자를 반환합니다
(public member function)