117template<
typename T,
typename Arena>
200template<typename T, typename Arena>
204 assert(arena &&
"Before working with SHM-stored STL-compliant objects: activate an Arena via Arena_activator "
205 "in the thread in question.");
212 return std::pointer_traits<Pointer>::pointer_to
213 (*(
static_cast<Value*
>
214 (arena->allocate(n *
sizeof(
Value)))));
217template<
typename T,
typename Arena>
221 assert(arena &&
"Before working with SHM-stored STL-compliant objects: activate an Arena via Arena_activator "
222 "in the thread in question.");
230 arena->deallocate(
static_cast<void*
>(p.operator->()));
233template<
typename T,
typename Arena>
236template<
typename T,
typename Arena>
243template<
typename T,
typename Arena>
250template<
typename Arena,
typename T1,
typename T2>
253 static_assert(std::is_empty_v<Stateless_allocator<T1, Arena>>,
254 "Stateless_allocator<> is currently designed around being empty (static-data-only) -- "
255 "did it gain state?");
259template<
typename Arena,
typename T1,
typename T2>
static Arena_obj * this_thread_active_arena()
Returns the active arena, as understood by Stateless_allocator<Arena_obj> at this point in the callin...
Stateless allocator usable with STL-compliant containers to store (or merely read) them directly in S...
Stateless_allocator()
Allocator concept requirement for default-ctor: no-op since it's a stateless allocator.
bool operator==(const Stateless_allocator< T1, Arena > &val1, const Stateless_allocator< T2, Arena > &val2)
Returns true for any 2 Stateless_allocators managing the same Stateless_allocator::Arena_obj.
bool operator!=(const Stateless_allocator< T1, Arena > &val1, const Stateless_allocator< T2, Arena > &val2)
Returns false for any 2 Stateless_allocators managing the same Stateless_allocator::Arena_obj.
typename Arena_obj::template Pointer< Value > Pointer
The required pointer-like type. See also pointer.
Pointer allocate(size_t n) const
Allocates an uninitialized buffer of given size, or throws exception if Arena_obj::allocate() does; s...
Arena Arena_obj
Short-hand for the Arena type this uses for allocation/deallocation/pointer semantics.
void deallocate(Pointer p, size_t n_ignored=0) const noexcept
Deallocates buffer in SHM previously allocated via allocate() in this or other (if Arena_obj supports...
Pointer pointer
Alias to Pointer for compatibility with STL-compliant machinery (traits, etc.).
Value value_type
Alias to Value for compatibility with STL-compliant machinery (traits, etc.).
ipc::shm sub-module providing integration between STL-compliant components (including containers) and...