std::basic_...ktrace::size(3)
NAME π
okay so this is the manual page for std::basic_stacktrace::size β and yes, the NAME line is literally std::basic_stacktrace::size - std::basic_stacktrace::size, she is self-titled and iconic. It lives in the C++ Standard Libary manual (typo preserved, it's canon), and the header shows her as std::basic_...ktrace::size(3). Bestie, we know what's up.
Synopsis β¨
size_type size() const noexcept; (since C++23)
Returns the number of entries in the stacktrace. That's the whole gig. π
Parameters π«Ά
(none) β literally no arguments. She takes nothing and still serves.
Return value π
The number of entries in the stacktrace.
Complexity πΈ
Constant. no cap, that's it.
Example π¦
The following code uses size to display the number of entries in the current stacktrace:
// Run this code
#include <stacktrace>
#include <iostream>
int main()
{
auto trace = 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 (public member function).max_sizeβ returns the maximum possible number of stacktrace entries (public member function).
That's the whole page, bestie. Cute little sign-off: this came from http://cppreference.com, dated 2024.06.10, and the page header title is std::basic_...ktrace::size(3) π
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms