This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++20 status.
Section: 220.127.116.11 [allocator.members] Status: C++20 Submitter: Casey Carter Opened: 2019-02-20 Last modified: 2021-02-25
View all other issues in [allocator.members].
View all issues with C++20 status.
18.104.22.168 [allocator.members]/2 says:
-2- Returns: A pointer to the initial element of an array of storage of size n * sizeof(T), aligned appropriately for objects of type T.
As in LWG 3038, we should not return too little storage for n objects of size sizeof(T), e.g. when n is SIZE_MAX / 2 and T is short.
[2019-03-05 Priority set to 3 after reflector discussion]
[2019 Cologne Wednesday night]
Status to Ready; will open additional issue to reconcile this and 3038
This wording is relative to N4800.
Change 22.214.171.124 [allocator.members] as indicated:
[[nodiscard]] T* allocate(size_t n);
[…]-4- Throws: bad_alloc if the storage cannot be obtained.