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]

[PATCH] Avoid copies in std::scoped_allocator_adaptor piecewise construction


While looking at LWG  2511 I realised that we can prevent
scoped_allocator_adaptor::construct(pair<T, U>*, ...) from making any
copies internally. The transformed tuples that get passed to the
std::pair constructor (with additional allocator arguments) can be
tuples of references even if the incoming tuples are not.

See P0475R0 (which will be in the pre-Issaquah mailing) for a proposal
to resolve LWG 2511 by requiring this behaviour.

	* include/std/scoped_allocator (scoped_allocator_adaptor): Forward
	piecewise construction arguments as tuples of references, to avoid
	copies (related to LWG 2511).
	* testsuite/20_util/scoped_allocator/construct_pair.cc: New test.

Tested powerpc64le-linux, committed to trunk.


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]