æ ååºæ 头 <stacktrace>
æ¥èªcppreference.com
æ¤å¤´æä»¶æ¯éç¨å·¥å ·åºçä¸é¨åã
ç±» | ||
(C++23) |
æ è¸ªä¸æ±å¼ç表示 (ç±») | |
(C++23) |
ç±æ 踪æ¡ç®ç»æçè°ç¨åºåçè¿ä¼¼è¡¨ç¤º (类模æ¿) | |
std::stacktrace_entry çæ£åæ¯æ (类模æ¿ç¹å) | ||
std::basic_stacktrace çæ£åæ¯æ (类模æ¿ç¹å) | ||
å置声æ | ||
å®ä¹äºå¤´æä»¶
<functional> | ||
(C++11) |
æ£å彿°å¯¹è±¡ (类模æ¿) | |
彿° | ||
ç¹å 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); template<class CharT, class traits> basic_ostream<CharT, traits>& operator<<(basic_ostream<CharT, traits>& os, const stacktrace_entry& f); template<class CharT, class Traits, class Allocator> basic_ostream<CharT, traits>& operator<<(basic_ostream<CharT, Traits>& 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 = /* ç±å®ç°å®ä¹ */; // æé 彿° 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 = /* ç±å®ç°å®ä¹ */; using iterator = const_iterator; using reverse_iterator = std::reverse_iterator<iterator>; using const_reverse_iterator = std::reverse_iterator<const_iterator>; using difference_type = /* ç±å®ç°å®ä¹ */; using size_type = /* ç±å®ç°å®ä¹ */; 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; [[nodiscard]] 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_; // ä» ç¨äºéé }; }