Commit 55992626 by Patrick Palka

libstdc++: Whitespace and formatting adjustments

libstdc++-v3/ChangeLog:

	* include/bits/ranges_algo.h: Adjust whitespace and formatting.
	* include/bits/ranges_algobase.h: Likewise.
	* include/bits/ranges_uninitialized.h: Likewise.
parent b40c57bd
2020-02-15 Patrick Palka <ppalka@redhat.com>
* include/bits/ranges_algo.h: Adjust whitespace and formatting.
* include/bits/ranges_algobase.h: Likewise.
* include/bits/ranges_uninitialized.h: Likewise.
* include/bits/ranges_algo.h: (adjacent_find, all_of, any_of,
binary_search, copy_if, count, count_if, equal_range, find, find_end,
find_first_of, find_if, find_if_not, for_each, generate, generate_n,
......
......@@ -73,7 +73,8 @@ namespace ranges
typename _Proj = identity,
indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
constexpr bool
operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const
operator()(_Iter __first, _Sent __last,
_Pred __pred, _Proj __proj = {}) const
{
for (; __first != __last; ++__first)
if (!(bool)std::__invoke(__pred, std::__invoke(__proj, *__first)))
......@@ -82,7 +83,8 @@ namespace ranges
}
template<input_range _Range, typename _Proj = identity,
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>>
_Pred>
constexpr bool
operator()(_Range&& __r, _Pred __pred, _Proj __proj = {}) const
{
......@@ -99,7 +101,8 @@ namespace ranges
typename _Proj = identity,
indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
constexpr bool
operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const
operator()(_Iter __first, _Sent __last,
_Pred __pred, _Proj __proj = {}) const
{
for (; __first != __last; ++__first)
if (std::__invoke(__pred, std::__invoke(__proj, *__first)))
......@@ -108,7 +111,8 @@ namespace ranges
}
template<input_range _Range, typename _Proj = identity,
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>>
_Pred>
constexpr bool
operator()(_Range&& __r, _Pred __pred, _Proj __proj = {}) const
{
......@@ -125,7 +129,8 @@ namespace ranges
typename _Proj = identity,
indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
constexpr bool
operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const
operator()(_Iter __first, _Sent __last,
_Pred __pred, _Proj __proj = {}) const
{
for (; __first != __last; ++__first)
if (std::__invoke(__pred, std::__invoke(__proj, *__first)))
......@@ -134,7 +139,8 @@ namespace ranges
}
template<input_range _Range, typename _Proj = identity,
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>>
_Pred>
constexpr bool
operator()(_Range&& __r, _Pred __pred, _Proj __proj = {}) const
{
......@@ -196,7 +202,8 @@ namespace ranges
requires indirect_binary_predicate<ranges::equal_to,
projected<_Iter, _Proj>, const _Tp*>
constexpr _Iter
operator()(_Iter __first, _Sent __last, const _Tp& __value, _Proj __proj = {}) const
operator()(_Iter __first, _Sent __last,
const _Tp& __value, _Proj __proj = {}) const
{
while (__first != __last
&& !(std::__invoke(__proj, *__first) == __value))
......@@ -211,8 +218,8 @@ namespace ranges
constexpr safe_iterator_t<_Range>
operator()(_Range&& __r, const _Tp& __value, _Proj __proj = {}) const
{
return (*this)(ranges::begin(__r), ranges::end(__r), __value,
std::move(__proj));
return (*this)(ranges::begin(__r), ranges::end(__r),
__value, std::move(__proj));
}
};
......@@ -224,7 +231,8 @@ namespace ranges
typename _Proj = identity,
indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
constexpr _Iter
operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const
operator()(_Iter __first, _Sent __last,
_Pred __pred, _Proj __proj = {}) const
{
while (__first != __last
&& !(bool)std::__invoke(__pred, std::__invoke(__proj, *__first)))
......@@ -251,7 +259,8 @@ namespace ranges
typename _Proj = identity,
indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
constexpr _Iter
operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const
operator()(_Iter __first, _Sent __last,
_Pred __pred, _Proj __proj = {}) const
{
while (__first != __last
&& (bool)std::__invoke(__pred, std::__invoke(__proj, *__first)))
......@@ -281,8 +290,8 @@ namespace ranges
requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2>
constexpr _Iter1
operator()(_Iter1 __first1, _Sent1 __last1,
_Iter2 __first2, _Sent2 __last2,
_Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
_Iter2 __first2, _Sent2 __last2, _Pred __pred = {},
_Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
{
for (; __first1 != __last1; ++__first1)
for (auto __iter = __first2; __iter != __last2; ++__iter)
......@@ -299,8 +308,8 @@ namespace ranges
requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>,
_Pred, _Proj1, _Proj2>
constexpr safe_iterator_t<_Range1>
operator()(_Range1&& __r1, _Range2&& __r2,
_Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
operator()(_Range1&& __r1, _Range2&& __r2, _Pred __pred = {},
_Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
{
return (*this)(ranges::begin(__r1), ranges::end(__r1),
ranges::begin(__r2), ranges::end(__r2),
......@@ -319,7 +328,8 @@ namespace ranges
projected<_Iter, _Proj>,
const _Tp*>
constexpr iter_difference_t<_Iter>
operator()(_Iter __first, _Sent __last, const _Tp& __value, _Proj __proj = {}) const
operator()(_Iter __first, _Sent __last,
const _Tp& __value, _Proj __proj = {}) const
{
iter_difference_t<_Iter> __n = 0;
for (; __first != __last; ++__first)
......@@ -348,7 +358,8 @@ namespace ranges
typename _Proj = identity,
indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
constexpr iter_difference_t<_Iter>
operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const
operator()(_Iter __first, _Sent __last,
_Pred __pred, _Proj __proj = {}) const
{
iter_difference_t<_Iter> __n = 0;
for (; __first != __last; ++__first)
......@@ -359,7 +370,8 @@ namespace ranges
template<input_range _Range,
typename _Proj = identity,
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>>
_Pred>
constexpr range_difference_t<_Range>
operator()(_Range&& __r, _Pred __pred, _Proj __proj = {}) const
{
......@@ -397,8 +409,9 @@ namespace ranges
typename _Proj1 = identity, typename _Proj2 = identity>
requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2>
constexpr mismatch_result<_Iter1, _Iter2>
operator()(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2,
_Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
operator()(_Iter1 __first1, _Sent1 __last1,
_Iter2 __first2, _Sent2 __last2, _Pred __pred = {},
_Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
{
while (__first1 != __last1 && __first2 != __last2
&& (bool)std::__invoke(__pred,
......@@ -417,8 +430,8 @@ namespace ranges
requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>,
_Pred, _Proj1, _Proj2>
constexpr mismatch_result<iterator_t<_Range1>, iterator_t<_Range2>>
operator()(_Range1&& __r1, _Range2&& __r2,
_Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
operator()(_Range1&& __r1, _Range2&& __r2, _Pred __pred = {},
_Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
{
return (*this)(ranges::begin(__r1), ranges::end(__r1),
ranges::begin(__r2), ranges::end(__r2),
......@@ -437,8 +450,9 @@ namespace ranges
typename _Proj1 = identity, typename _Proj2 = identity>
requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2>
constexpr subrange<_Iter1>
operator()(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2,
_Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
operator()(_Iter1 __first1, _Sent1 __last1,
_Iter2 __first2, _Sent2 __last2, _Pred __pred = {},
_Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
{
if (__first1 == __last1 || __first2 == __last2)
return {__first1, __first1};
......@@ -480,8 +494,8 @@ namespace ranges
requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>,
_Pred, _Proj1, _Proj2>
constexpr safe_subrange_t<_Range1>
operator()(_Range1&& __r1, _Range2&& __r2,
_Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
operator()(_Range1&& __r1, _Range2&& __r2, _Pred __pred = {},
_Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
{
return (*this)(ranges::begin(__r1), ranges::end(__r1),
ranges::begin(__r2), ranges::end(__r2),
......@@ -510,7 +524,8 @@ namespace ranges
if (__count == 1)
{
__first = ranges::find_if(std::move(__first), __last,
std::move(__value_comp), std::move(__proj));
std::move(__value_comp),
std::move(__proj));
if (__first == __last)
return {__first, __first};
else
......@@ -565,7 +580,8 @@ namespace ranges
template<forward_range _Range, typename _Tp,
typename _Pred = ranges::equal_to, typename _Proj = identity>
requires indirectly_comparable<iterator_t<_Range>, const _Tp*, _Pred, _Proj>
requires indirectly_comparable<iterator_t<_Range>, const _Tp*,
_Pred, _Proj>
constexpr safe_subrange_t<_Range>
operator()(_Range&& __r, range_difference_t<_Range> __count,
const _Tp& __value, _Pred __pred = {}, _Proj __proj = {}) const
......@@ -587,8 +603,8 @@ namespace ranges
requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2>
constexpr subrange<_Iter1>
operator()(_Iter1 __first1, _Sent1 __last1,
_Iter2 __first2, _Sent2 __last2,
_Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
_Iter2 __first2, _Sent2 __last2, _Pred __pred = {},
_Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
{
if constexpr (bidirectional_iterator<_Iter1>
&& bidirectional_iterator<_Iter2>)
......@@ -643,8 +659,8 @@ namespace ranges
requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>,
_Pred, _Proj1, _Proj2>
constexpr safe_subrange_t<_Range1>
operator()(_Range1&& __r1, _Range2&& __r2,
_Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
operator()(_Range1&& __r1, _Range2&& __r2, _Pred __pred = {},
_Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
{
return (*this)(ranges::begin(__r1), ranges::end(__r1),
ranges::begin(__r2), ranges::end(__r2),
......@@ -804,10 +820,12 @@ namespace ranges
template<input_range _Range, weakly_incrementable _Out,
typename _Proj = identity,
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>>
_Pred>
requires indirectly_copyable<iterator_t<_Range>, _Out>
constexpr copy_if_result<safe_iterator_t<_Range>, _Out>
operator()(_Range&& __r, _Out __result, _Pred __pred, _Proj __proj = {}) const
operator()(_Range&& __r, _Out __result,
_Pred __pred, _Proj __proj = {}) const
{
return (*this)(ranges::begin(__r), ranges::end(__r),
std::move(__result),
......@@ -912,7 +930,8 @@ namespace ranges
projected<_Iter1, _Proj1>,
projected<_Iter2, _Proj2>>>
constexpr binary_transform_result<_Iter1, _Iter2, _Out>
operator()(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2,
operator()(_Iter1 __first1, _Sent1 __last1,
_Iter2 __first2, _Sent2 __last2,
_Out __result, _Fp __binary_op,
_Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
{
......@@ -933,8 +952,8 @@ namespace ranges
projected<iterator_t<_Range2>, _Proj2>>>
constexpr binary_transform_result<safe_iterator_t<_Range1>,
safe_iterator_t<_Range2>, _Out>
operator()(_Range1&& __r1, _Range2&& __r2, _Out __result,
_Fp __binary_op, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
operator()(_Range1&& __r1, _Range2&& __r2, _Out __result, _Fp __binary_op,
_Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
{
return (*this)(ranges::begin(__r1), ranges::end(__r1),
ranges::begin(__r2), ranges::end(__r2),
......@@ -998,15 +1017,15 @@ namespace ranges
}
template<input_range _Range, typename _Tp, typename _Proj = identity,
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>>
_Pred>
requires indirectly_writable<iterator_t<_Range>, const _Tp&>
constexpr safe_iterator_t<_Range>
operator()(_Range&& __r,
_Pred __pred, const _Tp& __new_value, _Proj __proj = {}) const
{
return (*this)(ranges::begin(__r), ranges::end(__r),
std::move(__pred), __new_value,
std::move(__proj));
std::move(__pred), __new_value, std::move(__proj));
}
};
......@@ -1080,7 +1099,8 @@ namespace ranges
template<input_range _Range,
typename _Tp, output_iterator<const _Tp&> _Out,
typename _Proj = identity,
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>>
_Pred>
requires indirectly_copyable<iterator_t<_Range>, _Out>
constexpr replace_copy_if_result<safe_iterator_t<_Range>, _Out>
operator()(_Range&& __r, _Out __result,
......@@ -1129,8 +1149,7 @@ namespace ranges
constexpr safe_iterator_t<_Range>
operator()(_Range&& __r, _Fp __gen) const
{
return (*this)(ranges::begin(__r), ranges::end(__r),
std::move(__gen));
return (*this)(ranges::begin(__r), ranges::end(__r), std::move(__gen));
}
};
......@@ -1142,7 +1161,8 @@ namespace ranges
typename _Proj = identity,
indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
constexpr subrange<_Iter>
operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const
operator()(_Iter __first, _Sent __last,
_Pred __pred, _Proj __proj = {}) const
{
__first = ranges::find_if(__first, __last, __pred, __proj);
if (__first == __last)
......@@ -1161,7 +1181,8 @@ namespace ranges
}
template<forward_range _Range, typename _Proj = identity,
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>>
_Pred>
requires permutable<iterator_t<_Range>>
constexpr safe_subrange_t<_Range>
operator()(_Range&& __r, _Pred __pred, _Proj __proj = {}) const
......@@ -1181,7 +1202,8 @@ namespace ranges
projected<_Iter, _Proj>,
const _Tp*>
constexpr subrange<_Iter>
operator()(_Iter __first, _Sent __last, const _Tp& __value, _Proj __proj = {}) const
operator()(_Iter __first, _Sent __last,
const _Tp& __value, _Proj __proj = {}) const
{
auto __pred = [&] (auto&& __arg) {
return std::forward<decltype(__arg)>(__arg) == __value;
......@@ -1229,7 +1251,8 @@ namespace ranges
template<input_range _Range, weakly_incrementable _Out,
typename _Proj = identity,
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>>
_Pred>
requires indirectly_copyable<iterator_t<_Range>, _Out>
constexpr remove_copy_if_result<safe_iterator_t<_Range>, _Out>
operator()(_Range&& __r, _Out __result,
......@@ -1278,8 +1301,7 @@ namespace ranges
const _Tp& __value, _Proj __proj = {}) const
{
return (*this)(ranges::begin(__r), ranges::end(__r),
std::move(__result), __value,
std::move(__proj));
std::move(__result), __value, std::move(__proj));
}
};
......@@ -1292,7 +1314,8 @@ namespace ranges
indirect_equivalence_relation<
projected<_Iter, _Proj>> _Comp = ranges::equal_to>
constexpr subrange<_Iter>
operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const
operator()(_Iter __first, _Sent __last,
_Comp __comp = {}, _Proj __proj = {}) const
{
__first = ranges::adjacent_find(__first, __last, __comp, __proj);
if (__first == __last)
......@@ -1631,8 +1654,7 @@ namespace ranges
constexpr safe_subrange_t<_Range>
operator()(_Range&& __r, iterator_t<_Range> __middle) const
{
return (*this)(ranges::begin(__r),
std::move(__middle),
return (*this)(ranges::begin(__r), std::move(__middle),
ranges::end(__r));
}
};
......@@ -1648,7 +1670,8 @@ namespace ranges
weakly_incrementable _Out>
requires indirectly_copyable<_Iter, _Out>
constexpr rotate_copy_result<_Iter, _Out>
operator()(_Iter __first, _Iter __middle, _Sent __last, _Out __result) const
operator()(_Iter __first, _Iter __middle, _Sent __last,
_Out __result) const
{
auto __copy1 = ranges::copy(__middle,
std::move(__last),
......@@ -1664,10 +1687,8 @@ namespace ranges
constexpr rotate_copy_result<safe_iterator_t<_Range>, _Out>
operator()(_Range&& __r, iterator_t<_Range> __middle, _Out __result) const
{
return (*this)(ranges::begin(__r),
std::move(__middle),
ranges::end(__r),
std::move(__result));
return (*this)(ranges::begin(__r), std::move(__middle),
ranges::end(__r), std::move(__result));
}
};
......@@ -1708,7 +1729,8 @@ namespace ranges
typename _Comp = ranges::less, typename _Proj = identity>
requires sortable<_Iter, _Comp, _Proj>
constexpr _Iter
operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const
operator()(_Iter __first, _Sent __last,
_Comp __comp = {}, _Proj __proj = {}) const
{
auto __lasti = ranges::next(__first, __last);
std::push_heap(__first, __lasti,
......@@ -1735,7 +1757,8 @@ namespace ranges
typename _Comp = ranges::less, typename _Proj = identity>
requires sortable<_Iter, _Comp, _Proj>
constexpr _Iter
operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const
operator()(_Iter __first, _Sent __last,
_Comp __comp = {}, _Proj __proj = {}) const
{
auto __lasti = ranges::next(__first, __last);
std::pop_heap(__first, __lasti,
......@@ -1762,7 +1785,8 @@ namespace ranges
typename _Comp = ranges::less, typename _Proj = identity>
requires sortable<_Iter, _Comp, _Proj>
constexpr _Iter
operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const
operator()(_Iter __first, _Sent __last,
_Comp __comp = {}, _Proj __proj = {}) const
{
auto __lasti = ranges::next(__first, __last);
std::make_heap(__first, __lasti,
......@@ -1789,7 +1813,8 @@ namespace ranges
typename _Comp = ranges::less, typename _Proj = identity>
requires sortable<_Iter, _Comp, _Proj>
constexpr _Iter
operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const
operator()(_Iter __first, _Sent __last,
_Comp __comp = {}, _Proj __proj = {}) const
{
auto __lasti = ranges::next(__first, __last);
std::sort_heap(__first, __lasti,
......@@ -1854,7 +1879,8 @@ namespace ranges
indirect_strict_weak_order<projected<_Iter, _Proj>>
_Comp = ranges::less>
constexpr bool
operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const
operator()(_Iter __first, _Sent __last,
_Comp __comp = {}, _Proj __proj = {}) const
{
return (__last
== ranges::is_heap_until(__first, __last,
......@@ -1882,7 +1908,8 @@ namespace ranges
typename _Comp = ranges::less, typename _Proj = identity>
requires sortable<_Iter, _Comp, _Proj>
constexpr _Iter
operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const
operator()(_Iter __first, _Sent __last,
_Comp __comp = {}, _Proj __proj = {}) const
{
auto __lasti = ranges::next(__first, __last);
std::sort(std::move(__first), __lasti,
......@@ -1966,8 +1993,7 @@ namespace ranges
operator()(_Range&& __r, iterator_t<_Range> __middle,
_Comp __comp = {}, _Proj __proj = {}) const
{
return (*this)(ranges::begin(__r),
std::move(__middle),
return (*this)(ranges::begin(__r), std::move(__middle),
ranges::end(__r),
std::move(__comp), std::move(__proj));
}
......@@ -2092,7 +2118,8 @@ namespace ranges
indirect_strict_weak_order<projected<_Iter, _Proj>>
_Comp = ranges::less>
constexpr bool
operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const
operator()(_Iter __first, _Sent __last,
_Comp __comp = {}, _Proj __proj = {}) const
{
if (__first == __last)
return true;
......@@ -2142,8 +2169,7 @@ namespace ranges
_Comp __comp = {}, _Proj __proj = {}) const
{
return (*this)(ranges::begin(__r), std::move(__nth),
ranges::end(__r),
std::move(__comp), std::move(__proj));
ranges::end(__r), std::move(__comp), std::move(__proj));
}
};
......@@ -2187,8 +2213,7 @@ namespace ranges
const _Tp& __value, _Comp __comp = {}, _Proj __proj = {}) const
{
return (*this)(ranges::begin(__r), ranges::end(__r),
__value,
std::move(__comp), std::move(__proj));
__value, std::move(__comp), std::move(__proj));
}
};
......@@ -2232,8 +2257,7 @@ namespace ranges
const _Tp& __value, _Comp __comp = {}, _Proj __proj = {}) const
{
return (*this)(ranges::begin(__r), ranges::end(__r),
__value,
std::move(__comp), std::move(__proj));
__value, std::move(__comp), std::move(__proj));
}
};
......@@ -2293,8 +2317,7 @@ namespace ranges
_Comp __comp = {}, _Proj __proj = {}) const
{
return (*this)(ranges::begin(__r), ranges::end(__r),
__value,
std::move(__comp), std::move(__proj));
__value, std::move(__comp), std::move(__proj));
}
};
......@@ -2313,7 +2336,8 @@ namespace ranges
auto __i = ranges::lower_bound(__first, __last, __value, __comp, __proj);
if (__i == __last)
return false;
return !(bool)std::__invoke(__comp, __value, std::__invoke(__proj, *__i));
return !(bool)std::__invoke(__comp, __value,
std::__invoke(__proj, *__i));
}
template<forward_range _Range,
......@@ -2326,8 +2350,7 @@ namespace ranges
_Proj __proj = {}) const
{
return (*this)(ranges::begin(__r), ranges::end(__r),
__value,
std::move(__comp), std::move(__proj));
__value, std::move(__comp), std::move(__proj));
}
};
......@@ -2339,9 +2362,11 @@ namespace ranges
typename _Proj = identity,
indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
constexpr bool
operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const
operator()(_Iter __first, _Sent __last,
_Pred __pred, _Proj __proj = {}) const
{
__first = ranges::find_if_not(std::move(__first), __last, __pred, __proj);
__first = ranges::find_if_not(std::move(__first), __last,
__pred, __proj);
if (__first == __last)
return true;
++__first;
......@@ -2350,7 +2375,8 @@ namespace ranges
}
template<input_range _Range, typename _Proj = identity,
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>>
_Pred>
constexpr bool
operator()(_Range&& __r, _Pred __pred, _Proj __proj = {}) const
{
......@@ -2367,7 +2393,8 @@ namespace ranges
typename _Proj = identity,
indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
constexpr subrange<_Iter>
operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const
operator()(_Iter __first, _Sent __last,
_Pred __pred, _Proj __proj = {}) const
{
if constexpr (bidirectional_iterator<_Iter>)
{
......@@ -2378,7 +2405,8 @@ namespace ranges
for (;;)
if (__first == __tail)
return {std::move(__first), std::move(__lasti)};
else if (std::__invoke(__pred, std::__invoke(__proj, *__first)))
else if (std::__invoke(__pred,
std::__invoke(__proj, *__first)))
++__first;
else
break;
......@@ -2417,7 +2445,8 @@ namespace ranges
}
template<forward_range _Range, typename _Proj = identity,
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>>
_Pred>
requires permutable<iterator_t<_Range>>
constexpr safe_subrange_t<_Range>
operator()(_Range&& __r, _Pred __pred, _Proj __proj = {}) const
......@@ -2436,7 +2465,8 @@ namespace ranges
indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
requires permutable<_Iter>
subrange<_Iter>
operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const
operator()(_Iter __first, _Sent __last,
_Pred __pred, _Proj __proj = {}) const
{
auto __lasti = ranges::next(__first, __last);
auto __middle
......@@ -2446,7 +2476,8 @@ namespace ranges
}
template<bidirectional_range _Range, typename _Proj = identity,
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>>
_Pred>
requires permutable<iterator_t<_Range>>
safe_subrange_t<_Range>
operator()(_Range&& __r, _Pred __pred, _Proj __proj = {}) const
......@@ -2505,13 +2536,15 @@ namespace ranges
++__out_false;
}
return {std::move(__first), std::move(__out_true), std::move(__out_false)};
return {std::move(__first),
std::move(__out_true), std::move(__out_false)};
}
template<input_range _Range, weakly_incrementable _Out1,
weakly_incrementable _O2,
typename _Proj = identity,
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>>
_Pred>
requires indirectly_copyable<iterator_t<_Range>, _Out1>
&& indirectly_copyable<iterator_t<_Range>, _O2>
constexpr partition_copy_result<safe_iterator_t<_Range>, _Out1, _O2>
......@@ -2555,7 +2588,8 @@ namespace ranges
}
template<forward_range _Range, typename _Proj = identity,
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>>
_Pred>
constexpr safe_iterator_t<_Range>
operator()(_Range&& __r, _Pred __pred, _Proj __proj = {}) const
{
......@@ -2579,7 +2613,8 @@ namespace ranges
constexpr merge_result<_Iter1, _Iter2, _Out>
operator()(_Iter1 __first1, _Sent1 __last1,
_Iter2 __first2, _Sent2 __last2, _Out __result,
_Comp __comp = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
_Comp __comp = {},
_Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
{
while (__first1 != __last1 && __first2 != __last2)
{
......@@ -2614,7 +2649,8 @@ namespace ranges
safe_iterator_t<_Range2>,
_Out>
operator()(_Range1&& __r1, _Range2&& __r2, _Out __result,
_Comp __comp = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
_Comp __comp = {},
_Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
{
return (*this)(ranges::begin(__r1), ranges::end(__r1),
ranges::begin(__r2), ranges::end(__r2),
......@@ -2665,8 +2701,10 @@ namespace ranges
projected<_Iter2, _Proj2>>
_Comp = ranges::less>
constexpr bool
operator()(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2,
_Comp __comp = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
operator()(_Iter1 __first1, _Sent1 __last1,
_Iter2 __first2, _Sent2 __last2,
_Comp __comp = {},
_Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
{
while (__first1 != __last1 && __first2 != __last2)
if (std::__invoke(__comp,
......@@ -2686,8 +2724,8 @@ namespace ranges
return __first2 == __last2;
}
template<input_range _Range1, input_range _Range2, typename _Proj1 = identity,
typename _Proj2 = identity,
template<input_range _Range1, input_range _Range2,
typename _Proj1 = identity, typename _Proj2 = identity,
indirect_strict_weak_order<projected<iterator_t<_Range1>, _Proj1>,
projected<iterator_t<_Range2>, _Proj2>>
_Comp = ranges::less>
......@@ -2715,7 +2753,8 @@ namespace ranges
typename _Proj1 = identity, typename _Proj2 = identity>
requires mergeable<_Iter1, _Iter2, _Out, _Comp, _Proj1, _Proj2>
constexpr set_union_result<_Iter1, _Iter2, _Out>
operator()(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2,
operator()(_Iter1 __first1, _Sent1 __last1,
_Iter2 __first2, _Sent2 __last2,
_Out __result, _Comp __comp = {},
_Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
{
......@@ -2758,7 +2797,8 @@ namespace ranges
_Comp, _Proj1, _Proj2>
constexpr set_union_result<safe_iterator_t<_Range1>,
safe_iterator_t<_Range2>, _Out>
operator()(_Range1&& __r1, _Range2&& __r2, _Out __result, _Comp __comp = {},
operator()(_Range1&& __r1, _Range2&& __r2,
_Out __result, _Comp __comp = {},
_Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
{
return (*this)(ranges::begin(__r1), ranges::end(__r1),
......@@ -2771,7 +2811,8 @@ namespace ranges
inline constexpr __set_union_fn set_union{};
template<typename _Iter1, typename _Iter2, typename _Out>
using set_intersection_result = binary_transform_result<_Iter1, _Iter2, _Out>;
using set_intersection_result
= binary_transform_result<_Iter1, _Iter2, _Out>;
struct __set_intersection_fn
{
......@@ -2816,7 +2857,8 @@ namespace ranges
constexpr set_intersection_result<safe_iterator_t<_Range1>,
safe_iterator_t<_Range2>, _Out>
operator()(_Range1&& __r1, _Range2&& __r2, _Out __result,
_Comp __comp = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
_Comp __comp = {},
_Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
{
return (*this)(ranges::begin(__r1), ranges::end(__r1),
ranges::begin(__r2), ranges::end(__r2),
......@@ -2840,7 +2882,8 @@ namespace ranges
constexpr set_difference_result<_Iter1, _Out>
operator()(_Iter1 __first1, _Sent1 __last1,
_Iter2 __first2, _Sent2 __last2, _Out __result,
_Comp __comp = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
_Comp __comp = {},
_Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
{
while (__first1 != __last1 && __first2 != __last2)
if (std::__invoke(__comp,
......@@ -2871,7 +2914,8 @@ namespace ranges
_Comp, _Proj1, _Proj2>
constexpr set_difference_result<safe_iterator_t<_Range1>, _Out>
operator()(_Range1&& __r1, _Range2&& __r2, _Out __result,
_Comp __comp = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
_Comp __comp = {},
_Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
{
return (*this)(ranges::begin(__r1), ranges::end(__r1),
ranges::begin(__r2), ranges::end(__r2),
......@@ -2941,8 +2985,7 @@ namespace ranges
_Comp __comp = {},
_Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
{
return (*this)
(ranges::begin(__r1), ranges::end(__r1),
return (*this)(ranges::begin(__r1), ranges::end(__r1),
ranges::begin(__r2), ranges::end(__r2),
std::move(__result), std::move(__comp),
std::move(__proj1), std::move(__proj2));
......@@ -2957,7 +3000,8 @@ namespace ranges
indirect_strict_weak_order<projected<const _Tp*, _Proj>>
_Comp = ranges::less>
constexpr const _Tp&
operator()(const _Tp& __a, const _Tp& __b, _Comp __comp = {}, _Proj __proj = {}) const
operator()(const _Tp& __a, const _Tp& __b,
_Comp __comp = {}, _Proj __proj = {}) const
{
if (std::__invoke(std::move(__comp),
std::__invoke(__proj, __b),
......@@ -2994,7 +3038,8 @@ namespace ranges
indirect_strict_weak_order<projected<const _Tp*, _Proj>>
_Comp = ranges::less>
constexpr _Tp
operator()(initializer_list<_Tp> __r, _Comp __comp = {}, _Proj __proj = {}) const
operator()(initializer_list<_Tp> __r,
_Comp __comp = {}, _Proj __proj = {}) const
{
return (*this)(ranges::subrange(__r),
std::move(__comp), std::move(__proj));
......@@ -3009,7 +3054,8 @@ namespace ranges
indirect_strict_weak_order<projected<const _Tp*, _Proj>>
_Comp = ranges::less>
constexpr const _Tp&
operator()(const _Tp& __a, const _Tp& __b, _Comp __comp = {}, _Proj __proj = {}) const
operator()(const _Tp& __a, const _Tp& __b,
_Comp __comp = {}, _Proj __proj = {}) const
{
if (std::__invoke(std::move(__comp),
std::__invoke(__proj, __a),
......@@ -3046,7 +3092,8 @@ namespace ranges
indirect_strict_weak_order<projected<const _Tp*, _Proj>>
_Comp = ranges::less>
constexpr _Tp
operator()(initializer_list<_Tp> __r, _Comp __comp = {}, _Proj __proj = {}) const
operator()(initializer_list<_Tp> __r,
_Comp __comp = {}, _Proj __proj = {}) const
{
return (*this)(ranges::subrange(__r),
std::move(__comp), std::move(__proj));
......@@ -3078,7 +3125,8 @@ namespace ranges
indirect_strict_weak_order<projected<const _Tp*, _Proj>>
_Comp = ranges::less>
constexpr minmax_result<const _Tp&>
operator()(const _Tp& __a, const _Tp& __b, _Comp __comp = {}, _Proj __proj = {}) const
operator()(const _Tp& __a, const _Tp& __b,
_Comp __comp = {}, _Proj __proj = {}) const
{
if (std::__invoke(std::move(__comp),
std::__invoke(__proj, __b),
......@@ -3119,7 +3167,8 @@ namespace ranges
indirect_strict_weak_order<projected<const _Tp*, _Proj>>
_Comp = ranges::less>
constexpr minmax_result<_Tp>
operator()(initializer_list<_Tp> __r, _Comp __comp = {}, _Proj __proj = {}) const
operator()(initializer_list<_Tp> __r,
_Comp __comp = {}, _Proj __proj = {}) const
{
return (*this)(ranges::subrange(__r),
std::move(__comp), std::move(__proj));
......@@ -3263,8 +3312,7 @@ namespace ranges
{
if constexpr (__detail::__is_normal_iterator<_Iter1>
|| __detail::__is_normal_iterator<_Iter2>)
return (*this)
(std::__niter_base(std::move(__first1)),
return (*this)(std::__niter_base(std::move(__first1)),
std::__niter_base(std::move(__last1)),
std::__niter_base(std::move(__first2)),
std::__niter_base(std::move(__last2)),
......@@ -3331,8 +3379,8 @@ namespace ranges
return __first1 == __last1 && __first2 != __last2;
}
template<input_range _Range1, input_range _Range2, typename _Proj1 = identity,
typename _Proj2 = identity,
template<input_range _Range1, input_range _Range2,
typename _Proj1 = identity, typename _Proj2 = identity,
indirect_strict_weak_order<projected<iterator_t<_Range1>, _Proj1>,
projected<iterator_t<_Range2>, _Proj2>>
_Comp = ranges::less>
......@@ -3340,8 +3388,7 @@ namespace ranges
operator()(_Range1&& __r1, _Range2&& __r2, _Comp __comp = {},
_Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
{
return (*this)
(ranges::begin(__r1), ranges::end(__r1),
return (*this)(ranges::begin(__r1), ranges::end(__r1),
ranges::begin(__r2), ranges::end(__r2),
std::move(__comp),
std::move(__proj1), std::move(__proj2));
......
......@@ -79,8 +79,9 @@ namespace ranges
typename _Proj1 = identity, typename _Proj2 = identity>
requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2>
constexpr bool
operator()(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2,
_Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
operator()(_Iter1 __first1, _Sent1 __last1,
_Iter2 __first2, _Sent2 __last2, _Pred __pred = {},
_Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
{
// TODO: implement more specializations to at least have parity with
// std::equal.
......@@ -147,8 +148,8 @@ namespace ranges
requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>,
_Pred, _Proj1, _Proj2>
constexpr bool
operator()(_Range1&& __r1, _Range2&& __r2,
_Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
operator()(_Range1&& __r1, _Range2&& __r2, _Pred __pred = {},
_Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const
{
return (*this)(ranges::begin(__r1), ranges::end(__r1),
ranges::begin(__r2), ranges::end(__r2),
......@@ -493,7 +494,8 @@ namespace ranges
template<input_iterator _Iter, weakly_incrementable _Out>
requires indirectly_copyable<_Iter, _Out>
constexpr copy_n_result<_Iter, _Out>
operator()(_Iter __first, iter_difference_t<_Iter> __n, _Out __result) const
operator()(_Iter __first, iter_difference_t<_Iter> __n,
_Out __result) const
{
if constexpr (random_access_iterator<_Iter>)
return ranges::copy(__first, __first + __n, std::move(__result));
......@@ -512,7 +514,8 @@ namespace ranges
{
template<typename _Tp, output_iterator<const _Tp&> _Out>
constexpr _Out
operator()(_Out __first, iter_difference_t<_Out> __n, const _Tp& __value) const
operator()(_Out __first, iter_difference_t<_Out> __n,
const _Tp& __value) const
{
// TODO: implement more specializations to be at least on par with
// std::fill_n
......
......@@ -162,8 +162,7 @@ namespace ranges
safe_iterator_t<_Range>
operator()(_Range&& __r) const
{
return (*this)(ranges::begin(__r),
ranges::end(__r));
return (*this)(ranges::begin(__r), ranges::end(__r));
}
};
......@@ -175,8 +174,7 @@ namespace ranges
template<__detail::__nothrow_forward_iterator _Iter>
requires default_initializable<iter_value_t<_Iter>>
_Iter
operator()(_Iter __first,
iter_difference_t<_Iter> __n) const
operator()(_Iter __first, iter_difference_t<_Iter> __n) const
{
using _ValueType = remove_reference_t<iter_reference_t<_Iter>>;
if constexpr (is_trivially_default_constructible_v<_ValueType>)
......@@ -222,8 +220,7 @@ namespace ranges
safe_iterator_t<_Range>
operator()(_Range&& __r) const
{
return (*this)(ranges::begin(__r),
ranges::end(__r));
return (*this)(ranges::begin(__r), ranges::end(__r));
}
};
......@@ -297,10 +294,8 @@ namespace ranges
safe_iterator_t<_ORange>>
operator()(_IRange&& __inr, _ORange&& __outr) const
{
return (*this)(ranges::begin(__inr),
ranges::end(__inr),
ranges::begin(__outr),
ranges::end(__outr));
return (*this)(ranges::begin(__inr), ranges::end(__inr),
ranges::begin(__outr), ranges::end(__outr));
}
};
......@@ -386,10 +381,8 @@ namespace ranges
safe_iterator_t<_ORange>>
operator()(_IRange&& __inr, _ORange&& __outr) const
{
return (*this)(ranges::begin(__inr),
ranges::end(__inr),
ranges::begin(__outr),
ranges::end(__outr));
return (*this)(ranges::begin(__inr), ranges::end(__inr),
ranges::begin(__outr), ranges::end(__outr));
}
};
......@@ -460,8 +453,7 @@ namespace ranges
safe_iterator_t<_Range>
operator()(_Range&& __r, const _Tp& __x) const
{
return (*this)(ranges::begin(__r), ranges::end(__r),
__x);
return (*this)(ranges::begin(__r), ranges::end(__r), __x);
}
};
......@@ -541,7 +533,9 @@ namespace ranges
requires destructible<range_value_t<_Range>>
constexpr safe_iterator_t<_Range>
__destroy_fn::operator()(_Range&& __r) const noexcept
{ return (*this)(ranges::begin(__r), ranges::end(__r)); }
{
return (*this)(ranges::begin(__r), ranges::end(__r));
}
struct __destroy_n_fn
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment