template<class RawAllocator>
class foonathan::memory::reference_storage< RawAllocator >
A StoragePolicy that stores a reference to an allocator.
For stateful allocators it only stores a pointer to an allocator object and copying/moving only copies the pointer. For stateless allocators it does not store anything, an allocator will be constructed as needed. For allocators that are already shared (determined through is_shared_allocator) it will store the allocator type directly.
- Note
- It does not take ownership over the allocator in the stateful case, the user has to ensure that the allocator object stays valid. In the other cases the lifetime does not matter.