11#ifndef ROOT_TADOPTALLOCATOR
12#define ROOT_TADOPTALLOCATOR
59 using pointer =
typename StdAlloc_t::pointer;
71 enum class EAllocType :
char { kOwning, kAdopting, kAdoptingNoAllocYet };
93 template <
class U,
class... Args>
107 if (
n > std::size_t(-1) /
sizeof(
T))
108 throw std::bad_alloc();
154 template <
typename U>
159 template <
typename T>
174 template <
typename U>
178 throw std::runtime_error(
"Cannot rebind owning RAdoptAllocator");
183 template <
typename U,
class... Args>
typename StdAlloc_t::reference reference
typename StdAlloc_t::value_type value_type
typename StdAlloc_t::const_reference const_reference
typename StdAlloc_t::const_pointer const_pointer
std::allocator< bool > fStdAllocator
typename StdAlloc_t::pointer pointer
std::allocator< bool > StdAlloc_t
void deallocate(bool *p, std::size_t s) noexcept
typename StdAlloc_t::size_type size_type
RAdoptAllocator(const RAdoptAllocator &)=default
bool operator!=(const RAdoptAllocator &)
void construct(U *p, Args &&... args)
bool * allocate(std::size_t n)
RAdoptAllocator()=default
bool operator==(const RAdoptAllocator &)
RAdoptAllocator(const RAdoptAllocator< U > &o)
typename StdAlloc_t::difference_type difference_type
RAdoptAllocator can provide a view on already allocated memory.
typename StdAlloc_t::size_type size_type
size_type max_size() const
RAdoptAllocator(RAdoptAllocator &&)=default
bool operator==(const RAdoptAllocator< T > &other)
RAdoptAllocator(const RAdoptAllocator &)=default
RAdoptAllocator & operator=(RAdoptAllocator &&)=default
std::true_type propagate_on_container_swap
typename StdAlloc_t::const_reference const_reference
std::allocator_traits< StdAlloc_t > StdAllocTraits_t
RAdoptAllocator()=default
RAdoptAllocator & operator=(const RAdoptAllocator &)=default
typename StdAlloc_t::value_type value_type
void deallocate(pointer p, std::size_t n)
Dellocate some memory if that had not been adopted.
bool operator!=(const RAdoptAllocator< T > &other)
RAdoptAllocator(pointer p)
This is the constructor which allows the allocator to adopt a certain memory region.
typename StdAlloc_t::const_pointer const_pointer
std::true_type propagate_on_container_move_assignment
void construct(U *p, Args &&... args)
Construct an object at a certain memory address.
std::allocator< T > StdAlloc_t
pointer allocate(std::size_t n)
Allocate some memory If an address has been adopted, at the first call, that address is returned.
typename StdAlloc_t::pointer pointer
typename StdAlloc_t::difference_type difference_type
typename StdAlloc_t::reference reference
Namespace for new ROOT classes and functions.
static constexpr double s