-
- Downloads
libstdc++: Remove constraints on std::generator::promise_type::operator new
This was approved in Wrocław as LWG 3900, so that passing an incorrect
argument intended as an allocator will be ill-formed, instead of
silently ignored.
This also renames the template parameters and function parameters for
the allocators, to align with the names in the standard. I found it too
confusing to have a parameter _Alloc which doesn't correspond to Alloc
in the standard. Rename _Alloc to _Allocator (which the standard calls
Allocator) and rename _Na to _Alloc (which the standard calls Alloc).
libstdc++-v3/ChangeLog:
* include/std/generator (_Promise_alloc): Rename template
parameter. Use __alloc_rebind to rebind allocator.
(_Promise_alloc::operator new): Replace constraints with a
static_assert in the body. Rename allocator parameter.
(_Promise_alloc<void>::_M_allocate): Rename allocator parameter.
Use __alloc_rebind to rebind allocator.
(_Promise_alloc<void>::operator new): Rename allocator
parameter.
* testsuite/24_iterators/range_generators/alloc.cc: New test.
* testsuite/24_iterators/range_generators/lwg3900.cc: New test.
Reviewed-by:
Arsen Arsenović <arsen@aarsen.me>
Showing
- libstdc++-v3/include/std/generator 30 additions, 29 deletionslibstdc++-v3/include/std/generator
- libstdc++-v3/testsuite/24_iterators/range_generators/alloc.cc 71 additions, 0 deletions...tdc++-v3/testsuite/24_iterators/range_generators/alloc.cc
- libstdc++-v3/testsuite/24_iterators/range_generators/lwg3900.cc 16 additions, 0 deletions...c++-v3/testsuite/24_iterators/range_generators/lwg3900.cc
Loading
Please register or sign in to comment