Skip to content

Commit 08af548

Browse files
committed
Remove std::exchange dependency from std::set_intersection so it works before C++14
1 parent 0b57ea0 commit 08af548

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libcxx/include/__algorithm/set_intersection.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ struct _LIBCPP_NODISCARD_EXT __set_intersector {
8383
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
8484
__advance_and_maybe_add_result(_Iter& __iter, const _Sent& __sentinel, const _Value& __value) {
8585
// use one-sided lower bound for improved algorithmic complexity bounds
86-
const auto __tmp =
87-
std::exchange(__iter, std::__lower_bound_onesided<_AlgPolicy>(__iter, __sentinel, __value, __comp_, __proj_));
86+
const auto __tmp = std::move(__iter);
87+
__iter = std::__lower_bound_onesided<_AlgPolicy>(__iter, __sentinel, __value, __comp_, __proj_);
8888
__add_output_unless(__tmp != __iter);
8989
}
9090

0 commit comments

Comments
 (0)