std::basic_stacktrace<std::allocator<std::stacktrace_entry>>; (2) (C++23 起) 1) basic_stacktrace 类模板表示整个栈踪或其给定部分的快照。它满足知分配器容器 (AllocatorAwareContainer) 、序列容器 (SequenceContainer) 及可逆容器 (ReversibleContainer) 的要求,除了仅支持移动、复制、交换和 const 限定的顺...
std::basic_stacktrace<std::allocator<std::stacktrace_entry>>; (2)(since C++23) namespacepmr{ usingstacktrace= std::basic_stacktrace<std::pmr::polymorphic_allocator<std::stacktrace_entry>>; } (3)(since C++23) 1)Thebasic_stacktraceclass template represents a snapshot of the whole stacktrace ...
它对应原本 basic_stacktrace 的首条目之前的迭代器。此迭代器表现为占位符,试图解引用它导致未定义行为。 参数 (无) 返回值 逆向basic_stacktrace 的尾迭代器。 复杂度 常数。 示例运行此代码 #include <algorithm> #include <iostream> #include <stacktrace> int main() { auto trace = std::stacktrace::...
std::basic_stacktrace<Allocator>::current From cppreference.com <cpp |utility |basic stacktrace C++ staticbasic_stacktrace current(constallocator_type&alloc= allocator_type())noexcept; (1)(since C++23) staticbasic_stacktrace current(size_type skip,constallocator_type&alloc= ...
<cpp |utility |basic stacktrace C++ Checks if the stacktrace has no stacktrace entries. Parameters (none) Return value trueif the stacktrace is empty,falseotherwise. Complexity Constant. Example Run this code #include <stacktrace>#include <iostream>intmain(){std::cout<<std::boolalpha;std...
std::ostream&operator<<(std::ostream&os,conststd::basic_stacktrace<Allocator>&st); (since C++23) Inserts the description ofstinto the output streamos. Equivalent toreturnos<<std::to_string(st);. Parameters os-an output stream st-abasic_stacktracewhose description is to be inserted ...
template< class Allocator > struct hash<std::basic_stacktrace<Allocator>>; (C++23 起) std::hash 对std::basic_stacktrace 的模板特化允许用户获得 std::basic_stacktrace 类型值的哈希。 此特化的 operator() 为noexcept 。 示例 本节未完成原因:暂无示例 参阅 hash(C++11) 散列函数对象(类模板) std::...
#include <stacktrace>#include <iostream>intmain(){autotrace=std::stacktrace::current();std::cout<<"trace contains "<<trace.size()<<" entries.\n";} Possible output: trace contains 3 entries. See also empty checks whether thebasic_stacktraceis empty ...
structformatter<std::basic_stacktrace<Allocator>>; (since C++23) The template specialization ofstd::formatterforstd::basic_stacktrace<Allocator>allows users to convert a stacktrace object to string usingformatting functionssuch asstd::format.
other-basic_stacktraceto exchange the contents with Return value (none) Exceptions noexceptspecification: noexcept(std::allocator_traits<Allocator>::propagate_on_container_swap::value ||std::allocator_traits<Allocator>::is_always_equal::value) ...