This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
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.
Attachment:
patch.txt
Description: Text document
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |