////////////////////////////////////////////////////////////////////////////// // // (C) Copyright Ion Gaztanaga 2015-2015. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/container for documentation. // ////////////////////////////////////////////////////////////////////////////// #ifndef BOOST_CONTAINER_PMR_GLOBAL_RESOURCE_HPP #define BOOST_CONTAINER_PMR_GLOBAL_RESOURCE_HPP #if defined (_MSC_VER) # pragma once #endif #include #include #include #include #include namespace boost { namespace container { namespace pmr { //! Returns: A pointer to a static-duration object of a type derived from //! memory_resource that can serve as a resource for allocating memory using //! global `operator new` and global `operator delete`. The same value is returned every time this function //! is called. For return value p and memory resource r, p->is_equal(r) returns &r == p. BOOST_CONTAINER_DECL memory_resource* new_delete_resource() BOOST_NOEXCEPT; //! Returns: A pointer to a static-duration object of a type derived from //! memory_resource for which allocate() always throws bad_alloc and for which //! deallocate() has no effect. The same value is returned every time this function //! is called. For return value p and memory resource r, p->is_equal(r) returns &r == p. BOOST_CONTAINER_DECL memory_resource* null_memory_resource() BOOST_NOEXCEPT; //! Effects: If r is non-null, sets the value of the default memory resource //! pointer to r, otherwise sets the default memory resource pointer to new_delete_resource(). //! //! Postconditions: get_default_resource() == r. //! //! Returns: The previous value of the default memory resource pointer. //! //! Remarks: Calling the set_default_resource and get_default_resource functions shall //! not incur a data race. A call to the set_default_resource function shall synchronize //! with subsequent calls to the set_default_resource and get_default_resource functions. BOOST_CONTAINER_DECL memory_resource* set_default_resource(memory_resource* r) BOOST_NOEXCEPT; //! Returns: The current value of the default //! memory resource pointer. BOOST_CONTAINER_DECL memory_resource* get_default_resource() BOOST_NOEXCEPT; } //namespace pmr { } //namespace container { } //namespace boost { #include #endif //BOOST_CONTAINER_PMR_GLOBAL_RESOURCE_HPP