Namespaces
Variants

Standard library header <stacktrace> (C++23)

From cppreference.net
Standard library headers

이 헤더는 진단 라이브러리의 일부입니다.

목차

클래스

스택 트레이스에서의 평가 표현
(클래스)
호출 시퀀스의 근사적 표현으로 스택 트레이스 엔트리들로 구성됨
(클래스 템플릿)
std::stacktrace_entry 에 대한 해시 지원
(클래스 템플릿 특수화)
std::basic_stacktrace 에 대한 해시 지원
(클래스 템플릿 특수화)
전방 선언
헤더에 정의됨 <functional>
(C++11)
해시 함수 객체
(클래스 템플릿)
타입 별칭
별칭 타입
std::stacktrace std:: basic_stacktrace < std:: allocator < std:: stacktrace_entry >>
std::pmr::stacktrace std :: pmr :: basic_stacktrace <
std:: pmr :: polymorphic_allocator < std:: stacktrace_entry >>

함수

std::swap 알고리즘을 특수화합니다
(함수 템플릿)
(C++23)
stacktrace_entry 의 설명과 함께 문자열을 반환합니다
(함수)
(C++23)
basic_stacktrace 의 설명과 함께 문자열을 반환합니다
(함수 템플릿)
(C++23)
stacktrace_entry 의 스트림 출력을 수행합니다
(함수 템플릿)
(C++23)
basic_stracktrace 의 스트림 출력을 수행합니다
(함수 템플릿)

시놉시스

namespace std {
  // 클래스 stacktrace_entry
  class stacktrace_entry;
  // 클래스 템플릿 basic_stacktrace
  template<class Allocator>
    class basic_stacktrace;
  // basic_stacktrace typedef 이름들
  using stacktrace = basic_stacktrace<allocator<stacktrace_entry>>;
  // 비멤버 함수들
  template<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);
  namespace pmr {
    using stacktrace = std::basic_stacktrace<polymorphic_allocator<stacktrace_entry>>;
  }
  // 해시 지원
  template<class T> struct hash;
  template<> struct hash<stacktrace_entry>;
  template<class Allocator> struct hash<basic_stacktrace<Allocator>>;
}

클래스 std::stacktrace_entry

namespace std {
  class stacktrace_entry {
  public:
    using native_handle_type = /* implementation-defined */;
    // 생성자
    constexpr stacktrace_entry() noexcept;
    constexpr stacktrace_entry(const stacktrace_entry& other) noexcept;
    constexpr stacktrace_entry& operator=(const stacktrace_entry& other) noexcept;
    ~stacktrace_entry();
    // 관찰자
    constexpr native_handle_type native_handle() const noexcept;
    constexpr explicit operator bool() const noexcept;
    // 질의
    string description() const;
    string source_file() const;
    uint_least32_t source_line() const;
    // 비교
    friend constexpr bool operator==(const stacktrace_entry& x,
                                     const stacktrace_entry& y) noexcept;
    friend constexpr strong_ordering operator<=>(const stacktrace_entry& x,
                                                 const stacktrace_entry& y) noexcept;
  };
}

클래스 템플릿 std::basic_stacktrace

namespace std {
  template<class Allocator>
  class basic_stacktrace {
  public:
    using value_type = stacktrace_entry;
    using const_reference = const value_type&;
    using reference = value_type&;
    using const_iterator = /* implementation-defined */;
    using iterator = const_iterator;
    using reverse_iterator = std::reverse_iterator<iterator>;
    using const_reverse_iterator = std::reverse_iterator<const_iterator>;
    using difference_type = /* implementation-defined */;
    using size_type = /* implementation-defined */;
    using allocator_type = Allocator;
    // 생성 및 할당
    static basic_stacktrace
      current(const allocator_type& alloc = allocator_type()) noexcept;
    static basic_stacktrace
      current(size_type skip, const allocator_type& alloc = allocator_type()) noexcept;
    static basic_stacktrace
      current(size_type skip, size_type max_depth,
              const allocator_type& alloc = allocator_type()) noexcept;
    basic_stacktrace() noexcept(is_nothrow_default_constructible_v<allocator_type>);
    explicit basic_stacktrace(const allocator_type& alloc) noexcept;
    basic_stacktrace(const basic_stacktrace& other);
    basic_stacktrace(basic_stacktrace&& other) noexcept;
    basic_stacktrace(const basic_stacktrace& other, const allocator_type& alloc);
    basic_stacktrace(basic_stacktrace&& other, const allocator_type& alloc);
    basic_stacktrace& operator=(const basic_stacktrace& other);
    basic_stacktrace& operator=(basic_stacktrace&& other) noexcept(
        allocator_traits<Allocator>::propagate_on_container_move_assignment::value ||
        allocator_traits<Allocator>::is_always_equal::value);
    ~basic_stacktrace();
    // 관찰자
    allocator_type get_allocator() const noexcept;
    const_iterator begin() const noexcept;
    const_iterator end() const noexcept;
    const_reverse_iterator rbegin() const noexcept;
    const_reverse_iterator rend() const noexcept;
    const_iterator cbegin() const noexcept;
    const_iterator cend() const noexcept;
    const_reverse_iterator crbegin() const noexcept;
    const_reverse_iterator crend() const noexcept;
    bool empty() const noexcept;
    size_type size() const noexcept;
    size_type max_size() const noexcept;
    const_reference operator[](size_type) const;
    const_reference at(size_type) const;
    // 비교
    template<class Allocator2>
    friend bool operator==(const basic_stacktrace& x,
                           const basic_stacktrace<Allocator2>& y) noexcept;
    template<class Allocator2>
    friend strong_ordering operator<=>(const basic_stacktrace& x,
                                       const basic_stacktrace<Allocator2>& y) noexcept;
    // 수정자
    void swap(basic_stacktrace& other)
      noexcept(allocator_traits<Allocator>::propagate_on_container_swap::value ||
        allocator_traits<Allocator>::is_always_equal::value);
  private:
    vector<value_type, allocator_type> frames_;         // 설명 전용
  };
}