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]

Re: Extending Temporary buffer for rvalues



On 28 Aug 2009, at 10:31, Paolo Carlini wrote:


Hi Chris,
Another attempt at a patch!
Good, I like this version much better. But, I think you should rewrite
the loop somewhat differently if you want it to actually work with
*forward* iterators, you can't use, eg, __cur - 1 (by the way, as a
minor detail, normally ++__cur is to be preferred to __cur++)

How's this?


Added a couple of tests. Note that this patch isn't enough to let stable_sort sort rvalue references, so that isn't tested. These tests just ensure the code works properly if a construction throws (at least no memory is leaked).

2009-08-29  Chris Jefferson <chris@bubblescope.net>
	* includes/bits/move.h : Add _GLIBCXX_FORWARD to wrap std::forward.
	* include/bits/stl_uninitialized.h : Add
	__uninitialized_construct_range.
	* include/bits/stl_tempbuf.h (_Temporary_buffer) : Make work with
	move-only types.
	* include/bits/stl_construct.h (_Construct) : Add perfect forwarding.
	* testsuite/25_algorithms/stable_partition/mem_check.cc : New.
	* testsuite/25_algorithms/stable_sort/mem_check.cc : New.
	* testsuite/util/testsuite_hooks.h : Add operator< to copy_tracker.

Attachment: temp_buf_patch_4
Description: Binary data



Chris
Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]