std::experi...lt_resource(3)

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

okay so this is the std::experi...lt_resource(3) page, and it lives in the C++ Standard Libary manual πŸ’… (yes, that’s the manual name, iykyk). We’re talking about std::experimental::pmr::set_default_resource, and it’s giving very β€œsmall function, big responsibility” energy πŸ‘‘

πŸ’– NAME πŸ’–

std::experimental::pmr::set_default_resource β€” std::experimental::pmr::set_default_resource

✨ Synopsis ✨

Defined in header <experimental/memory_resource>
memory_resource* set_default_resource( memory_resource* r  (library fundamentals TS)
) noexcept;

If r is not null, this sets the default memory resource pointer to r; otherwise, it sets the default memory resource pointer to new_delete_resource(). πŸ’–

The default memory resource pointer is used by certain facilities when an explicit memory resource is not supplied. The initial default memory resource pointer is the return value of new_delete_resource(). 🌸

This function is thread-safe. Every call to set_default_resource synchronizes with (see std::memory_order) the subsequent set_default_resource and get_default_resource calls. πŸ”₯

🫢 Return value 🫢

It returns the previous value of the default memory resource pointer. That’s the whole return value, bestie πŸŽ€

πŸ‘€ See also πŸ‘€

  • get_default_resource β€” gets the default memory_resource (function)
  • new_delete_resource β€” returns a static program-wide memory_resource that uses the global operator new and operator delete to allocate and deallocate memory (function)

🏷️ Category 🏷️

  • Noindexed pages

xoxo, your Unix bestie πŸ’– β€” source/version: http://cppreference.com, date: 2024.06.10

πŸ“¦ where this page comes from