gcc/libstdc++-v3/include
Patrick Palka 144dfc68d0 libstdc++: Move-only input iterator support in <memory> algorithms (LWG 3355)
This adds support for move-only input iterators in the ranges::unitialized_*
algorithms defined in <memory>, as per LWG 3355.  The only changes needed are to
add calls to std::move in the appropriate places and to use operator- instead of
ranges::distance because the latter cannot be used with a move-only iterator
that has a sized sentinel, as is the case here.  (This issue with
ranges::distance is LWG 3392.)

libstdc++-v3/ChangeLog:

	LWG 3355 The memory algorithms should support move-only input iterators
	introduced by P1207
	* include/bits/ranges_uninitialized.h
	(__uninitialized_copy_fn::operator()): Use std::move to avoid attempting
	to copy __ifirst, which could be a move-only input iterator.  Use
	operator- instead of ranges::distance to compute distance from a sized
	sentinel.
	(__uninitialized_copy_n_fn::operator()): Likewise.
	(__uninitialized_move_fn::operator()): Likewise.
	(__uninitialized_move_n_fn::operator()): Likewise.
	(__uninitialized_destroy_fn::operator()): Use std::move to avoid
	attempting to copy __first.
	(__uninitialized_destroy_n_fn::operator()): Likewise.
	* testsuite/20_util/specialized_algorithms/destroy/constrained.cc:
	Augment test.
	* .../specialized_algorithms/uninitialized_copy/constrained.cc:
	Likewise.
	* .../specialized_algorithms/uninitialized_move/constrained.cc:
	Likewise.
2020-03-03 22:44:39 -05:00
..
backward
bits libstdc++: Move-only input iterator support in <memory> algorithms (LWG 3355) 2020-03-03 22:44:39 -05:00
c
c_compatibility
c_global
c_std
debug libstdc++: Define <=> for Debug Mode array 2020-02-27 15:13:16 +00:00
decimal
experimental libstdc++: enable_view has false positives (LWG 3326) 2020-02-24 12:15:05 +00:00
ext libstdc++: Implement P1878R1 "Constraining Readable Types" 2020-02-07 16:58:43 +00:00
parallel
precompiled
pstl
std libstdc++: Rename __detail::__maybe_empty_t alias template 2020-03-02 17:03:28 +00:00
tr1
tr2
Makefile.am libstdc++: Add lightweight replacement for std::numeric_limits (PR 92546) 2020-02-17 15:11:04 +00:00
Makefile.in libstdc++: Add lightweight replacement for std::numeric_limits (PR 92546) 2020-02-17 15:11:04 +00:00