Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:34:56

0001 //////////////////////////////////////////////////////////////////////////////
0002 //
0003 // (C) Copyright Ion Gaztanaga 2015-2015. Distributed under the Boost
0004 // Software License, Version 1.0. (See accompanying file
0005 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 // See http://www.boost.org/libs/container for documentation.
0008 //
0009 //////////////////////////////////////////////////////////////////////////////
0010 
0011 #ifndef BOOST_CONTAINER_PMR_GLOBAL_RESOURCE_HPP
0012 #define BOOST_CONTAINER_PMR_GLOBAL_RESOURCE_HPP
0013 
0014 #if defined (_MSC_VER)
0015 #  pragma once 
0016 #endif
0017 
0018 #include <boost/container/detail/config_begin.hpp>
0019 #include <boost/container/detail/workaround.hpp>
0020 #include <boost/container/detail/auto_link.hpp>
0021 #include <boost/container/container_fwd.hpp>
0022 
0023 #include <cstddef>
0024 
0025 namespace boost {
0026 namespace container {
0027 namespace pmr {
0028 
0029 //! <b>Returns</b>: A pointer to a static-duration object of a type derived from
0030 //!   memory_resource that can serve as a resource for allocating memory using
0031 //!   global `operator new` and global `operator delete`. The same value is returned every time this function
0032 //!   is called. For return value p and memory resource r, p->is_equal(r) returns &r == p.
0033 BOOST_CONTAINER_DECL memory_resource* new_delete_resource() BOOST_NOEXCEPT;
0034 
0035 //! <b>Returns</b>: A pointer to a static-duration object of a type derived from
0036 //!   memory_resource for which allocate() always throws bad_alloc and for which
0037 //!   deallocate() has no effect. The same value is returned every time this function
0038 //!   is called. For return value p and memory resource r, p->is_equal(r) returns &r == p.
0039 BOOST_CONTAINER_DECL memory_resource* null_memory_resource() BOOST_NOEXCEPT;
0040 
0041 //! <b>Effects</b>: If r is non-null, sets the value of the default memory resource
0042 //!   pointer to r, otherwise sets the default memory resource pointer to new_delete_resource().
0043 //!
0044 //! <b>Postconditions</b>: get_default_resource() == r.
0045 //!
0046 //! <b>Returns</b>: The previous value of the default memory resource pointer.
0047 //!
0048 //! <b>Remarks</b>: Calling the set_default_resource and get_default_resource functions shall
0049 //!   not incur a data race. A call to the set_default_resource function shall synchronize
0050 //!   with subsequent calls to the set_default_resource and get_default_resource functions.
0051 BOOST_CONTAINER_DECL memory_resource* set_default_resource(memory_resource* r) BOOST_NOEXCEPT;
0052 
0053 //! <b>Returns</b>: The current value of the default
0054 //!   memory resource pointer.
0055 BOOST_CONTAINER_DECL memory_resource* get_default_resource() BOOST_NOEXCEPT;
0056 
0057 }  //namespace pmr {
0058 }  //namespace container {
0059 }  //namespace boost {
0060 
0061 #include <boost/container/detail/config_end.hpp>
0062 
0063 #endif   //BOOST_CONTAINER_PMR_GLOBAL_RESOURCE_HPP