What type is used by std::allocate_shared to allocate memory?

From https://en.cppreference.com/w/cpp/memory/shared_ptr/allocate_shared:

template< class T, class Alloc, class... Args >
shared_ptr<T> allocate_shared( const Alloc& alloc, Args&&... args );

The storage is typically larger than sizeof(T) in order to use one allocation for both the control block of the shared pointer and the T object. … All memory allocation is done using a copy of alloc, which must satisfy the Allocator requirements.

What type is then used to allocate the aforementioned storage? In other words, what should be Alloc::value_type, one of the Allocator requirements?

Source: Windows Questions C++

LEAVE A COMMENT