std::pmr::m...er_resource(3)
π NAME π
std::pmr::monotonic_buffer_resource::monotonic_buffer_resource β std::pmr::monotonic_buffer_resource::monotonic_buffer_resource. Yep, the constructor is named exactly like the class; main character energy only. This page is std::pmr::m...er_resource(3) from the C++ Standard Libary manual β and yes, that's the manual name up top, typo included, we preserve it π
.
β¨ Synopsis β¨
Okay so here's the overload lineup, and every single one is (since C++17):
- Overload (1) β
(since C++17)βmonotonic_buffer_resource(); - Overload (2) β
(since C++17)βexplicit monotonic_buffer_resource( std::pmr::memory_resource* upstream ); - Overload (3) β
(since C++17)βexplicit monotonic_buffer_resource( std::size_t initial_size ); - Overload (4) β
(since C++17)βmonotonic_buffer_resource( std::size_t initial_size, std::pmr::memory_resource* upstream ); - Overload (5) β
(since C++17)βmonotonic_buffer_resource( void* buffer, std::size_t buffer_size ); - Overload (6) β
(since C++17)βmonotonic_buffer_resource( void* buffer, std::size_t buffer_size, std::pmr::memory_resource* upstream ); - Overload (7) β
(since C++17)βmonotonic_buffer_resource( const monotonic_buffer_resource& ) = delete;
Now the deets, because this constructor has lore. It constructs a monotonic_buffer_resource. The constructors that do not take an upstream memory resource pointer use the return value of std::pmr::get_default_resource as the upstream memory resource. That's the default-resource pipeline, iykyk.
- 1,2) Sets the current buffer to null and the next buffer size to an implementation-defined size.
- 3,4) Sets the current buffer to null and the next buffer size to a size no smaller than
initial_size. - 5,6) Sets the current buffer to
bufferand the next buffer size tobuffer_size(but not less than 1). Then increase the next buffer size by an implementation-defined growth factor (which does not have to be integral). - 7) Copy constructor is deleted.
π Parameters π
upstreamβ the upstream memory resource to use; it must point to a valid memory resource.initial_sizeβ the minimum size of the first buffer to allocate; it must be greater than zero.bufferβ the initial buffer to use.buffer_sizeβ the size of the initial buffer; it cannot be greater than the number of bytes inbuffer.
π¨ Constraint check, bestie:upstreamhas to point to a valid memory resource,initial_sizehas to be greater than zero, andbuffer_sizecannot be greater than the number of bytes inbuffer. These are not vibes, they're rules. Periodt.
Cute little sign-off: this page came from http://cppreference.com, dated 2024.06.10, and it's the std::pmr::m...er_resource(3) page. Go forth and construct your monotonic buffer resource, icon πβ¨π¦
π¦ 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