Section: 18.104.22.168.1 [allocator.requirements.general] Status: New Submitter: Jiang An Opened: 2022-03-18 Last modified: 2022-05-17 11:58:16 UTC
View all other issues in [allocator.requirements.general].
View all issues with New status.
Currently (at least since P0593R6), the allocate function of an allocator is required to create an array of elements (22.214.171.124.1 [allocator.requirements.general]), which means the allocated storage must be properly aligned (otherwise the array of requested size can't be created). However, according to paragraph 12 it is also allowed that "the allocator also may silently ignore the requested alignment".IMO the allowance is contradictory and should be removed.
[2022-05-17; Reflector poll]
Set priority to 3 after reflector poll.
"You can allocate from such an allocator but you can't construct objects in the allocated memory without manually checking the alignment of the returned pointer. That doesn't seem useful in practice."
"maybe even NAD/LEWG? I can't see us declaring most in-the-wild allocators to no longer be allocators. If anything, a design change is necessary to have a protocol for allocators to declare proper support for overalignment and for allocator_traits to implement such support "manually" for older allocators."