std::basic_...ce::max_size(3)
okay bestie, welcome to the C++ Standard Libary corner of the man pages π
this one is all about std::basic_stacktrace::max_size β and yes, the truncated title std::basic_...ce::max_size is just the man page being dramatic and saving space, iykyk.
β¨ NAME β¨
std::basic_stacktrace::max_size β std::basic_stacktrace::max_size π«Ά literally the member that tells you the biggest number of elements the underlying container can theoretically hold.
πΈ Synopsis πΈ
size_type max_size() const noexcept; (since C++23)
Returns the maximum number of elements the underlying container (typically a std::vector) is able to hold due to system or library implementation limitations, i.e. std::distance(begin(), end()) for the largest underlying container. No cap, it's giving theoretical maximum β¨
π Parameters π
(none) β not a single argument, she takes zero notes π
π Return value π
Maximum number of elements. That's it, that's the whole vibe.
π₯ Complexity π₯
Constant. O(1) energy, no scrolling required.
π Notes π
This value typically reflects the theoretical limit on the size of the underlying container, at most std::numeric_limits<difference_type>::max(). At runtime, the size of the container may be limited to a value smaller than max_size() by the amount of RAM available. So likeβ¦ she could hold that many, but your RAM said βbestie noβ π
π Example π
// Run this code
#include <iostream>
#include <stacktrace>
int main()
{
std::stacktrace trace;
std::cout << "Maximum size of a 'basic_stacktrace' is " <<
trace.max_size() << "\n";
}
π Possible output:
Maximum size of a 'basic_stacktrace' is 1152921504606846975
π¦ See also
sizeβ returns the number of stacktrace entries (public member function). The actual count, not the dream count π
that's the whole page, bestie! sourced from http://cppreference.com, dated 2024.06.10 β and the manual is std::basic_...ce::max_size(3), mwah π
π¦ 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