std::pmr::u...ol_resource(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’… NAME πŸ’…

Yo bestie, welcome to std::pmr::u...ol_resource(3) πŸ’– This page is from the C++ Standard Libary manual (yes, that's literally how the header spells it β€” not me, I'm just the messenger 😭), and the full name on the cover is:

std::pmr::unsynchronized_pool_resource::unsynchronized_pool_resource

It's giving "constructor of the pool resource" energy, and we're about to get into every overload. Periodt.


✨ Synopsis ✨

All five overloads are since C++17, and the exact lineup is:

          unsynchronized_pool_resource();
       (1) (since C++17)
          explicit unsynchronized_pool_resource( std::pmr::memory_resource*
       (2) (since C++17)
          upstream );
          explicit unsynchronized_pool_resource( const
       (3) (since C++17)
          std::pmr::pool_options& opts );
          unsynchronized_pool_resource( const std::pmr::pool_options& opts,
                                        std::pmr::memory_resource* upstream
       (4) (since C++17)
          );
          unsynchronized_pool_resource( const unsynchronized_pool_resource&
       (5) (since C++17)
          ) = delete;

Overloads (1)–(4) construct an unsynchronized_pool_resource using the specified upstream memory resource and tuned according to the specified options. The resulting object holds a copy of upstream but does not own the resource to which upstream points β€” write that down, bestie, it's important 🫢

The overloads that don't take opts as a parameter use a default constructed instance of pool_options as the options. The overloads that don't take upstream as a parameter use the return value of std::pmr::get_default_resource() as the upstream memory resource ✨

Overload (5) is the copy constructor, and it is = delete β€” as in, deleted. No copying. Not today. πŸ’€


πŸŽ€ Parameters πŸŽ€

  • opts β€” a std::pmr::pool_options struct containing the constructor options πŸ’–
  • upstream β€” the upstream memory resource to use πŸ¦‹

🌸 Exceptions 🌸

For overloads (1)–(4), it throws only if a call to the allocate() function of the upstream resource throws.

🫢 heads up: it is unspecified if or under what conditions such a call takes place.

That's the whole exception vibe check β€” no extra drama, no cap.


Source/version/date sign-off: http://cppreference.com β€’ 2024.06.10 β€’ page std::pmr::u...ol_resource(3) β€” bye bestie, mwah πŸ’–βœ¨

πŸ“¦ where this page comes from