C++ named requirements: Allocator

Encapsulates strategies for access/addressing, allocation/deallocation and construction/destruction of objects.

# Declarations

template<class Alloc>
concept /*simple-allocator*/ = requires(Alloc alloc, std::size_t n)
{
{ *alloc.allocate(n) } -> std::same_as<typename Alloc::value_type&>;
{ alloc.deallocate(alloc.allocate(n), n) };
} && std::copy_constructible<Alloc>
&& std::equality_comparable<Alloc>;

# Defect reports

DRApplied toBehavior as publishedCorrect behavior
LWG 179C++98pointer and const_pointer were notrequired to be comparable with each otherrequired
LWG 199C++98the return value of a.allocate(0) was unclearit is unspecified
LWG 258(N2436)C++98the equality relationship between allocators werenot required to be reflexive, symmetric or transitiverequired to be reflexive,symmetric and transitive
LWG 274C++98T could be a const-qualified type or reference type,making std::allocator possibly ill-formed[1]prohibited these types
LWG 2016C++11the copy, move and swap operations ofallocator might be throwing when usedrequired to be non-throwing
LWG 2081C++98C++11allocators were not required to support copyassignment (C++98) and move assignment (C++11)required
LWG 2108C++11there was no way to show an allocator is statelessis_always_equal provided
LWG 2263C++11the resolution of LWG issue 179 was accidently dropped in C++11and not generalized to void_pointer and const_void_pointerrestored and generalized
LWG 2447C++11T could be a volatile-qualified object typeprohibited these types
LWG 2593C++11moving from an allocator might modify its valuemodification forbidden
P0593R6C++98allocate were not required to create anarray object in the storage it allocatedrequired