[PATCH] PR78052 Define std::allocator<void>::{construct,destroy}

Jonathan Wakely jwakely@redhat.com
Thu Oct 20 11:37:00 GMT 2016


On 20/10/16 11:12 +0100, Jonathan Wakely wrote:
>This let's std::allocator<void> be used in situations like:
>
>std::allocate_shared<int>(std::allocator<void>(), 1);
>
>where a "proto-allocator" is required. The other members such as
>allocate() and max_size() don't make sense for void, but construct and
>destroy don't depend on value_type.
>
>	PR libstdc++/78052
>	* include/bits/allocator.h (allocator<void>::construct)
>	(allocator<void>::destroy): Define.
>	* testsuite/20_util/allocator/void.cc: New test.
>
>Tested x86_64-linux, committed to trunk. Also applying to gcc-5 and
>gcc-6 branches, because this used to work before I put in the
>allocator_traits<allocator<T>> partial specialization.

Some whitespace cleanup in the allocator files.

Committed to trunk.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 4498 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20161020/28454e2b/attachment.bin>


More information about the Libstdc++ mailing list