mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-05 09:44:10 +08:00
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.
This commit is contained in:
parent
b40c57bdd2
commit
5599262661
@ -1,5 +1,9 @@
|
||||
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,
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -79,19 +79,20 @@ 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.
|
||||
if constexpr (__detail::__is_normal_iterator<_Iter1>
|
||||
|| __detail::__is_normal_iterator<_Iter2>)
|
||||
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)),
|
||||
std::move(__pred),
|
||||
std::move(__proj1), std::move(__proj2));
|
||||
std::__niter_base(std::move(__last1)),
|
||||
std::__niter_base(std::move(__first2)),
|
||||
std::__niter_base(std::move(__last2)),
|
||||
std::move(__pred),
|
||||
std::move(__proj1), std::move(__proj2));
|
||||
|
||||
constexpr bool __sized_iters
|
||||
= (sized_sentinel_for<_Sent1, _Iter1>
|
||||
@ -147,13 +148,13 @@ 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),
|
||||
std::move(__pred),
|
||||
std::move(__proj1), std::move(__proj2));
|
||||
ranges::begin(__r2), ranges::end(__r2),
|
||||
std::move(__pred),
|
||||
std::move(__proj1), std::move(__proj2));
|
||||
}
|
||||
};
|
||||
|
||||
@ -312,7 +313,7 @@ namespace ranges
|
||||
operator()(_Range&& __r, _Out __result) const
|
||||
{
|
||||
return (*this)(ranges::begin(__r), ranges::end(__r),
|
||||
std::move(__result));
|
||||
std::move(__result));
|
||||
}
|
||||
};
|
||||
|
||||
@ -337,7 +338,7 @@ namespace ranges
|
||||
operator()(_Range&& __r, _Out __result) const
|
||||
{
|
||||
return (*this)(ranges::begin(__r), ranges::end(__r),
|
||||
std::move(__result));
|
||||
std::move(__result));
|
||||
}
|
||||
};
|
||||
|
||||
@ -454,7 +455,7 @@ namespace ranges
|
||||
operator()(_Range&& __r, _Iter __result) const
|
||||
{
|
||||
return (*this)(ranges::begin(__r), ranges::end(__r),
|
||||
std::move(__result));
|
||||
std::move(__result));
|
||||
}
|
||||
};
|
||||
|
||||
@ -479,7 +480,7 @@ namespace ranges
|
||||
operator()(_Range&& __r, _Iter __result) const
|
||||
{
|
||||
return (*this)(ranges::begin(__r), ranges::end(__r),
|
||||
std::move(__result));
|
||||
std::move(__result));
|
||||
}
|
||||
};
|
||||
|
||||
@ -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));
|
||||
}
|
||||
};
|
||||
|
||||
@ -266,7 +263,7 @@ namespace ranges
|
||||
requires constructible_from<iter_value_t<_Out>, iter_reference_t<_Iter>>
|
||||
uninitialized_copy_result<_Iter, _Out>
|
||||
operator()(_Iter __ifirst, _ISent __ilast,
|
||||
_Out __ofirst, _OSent __olast) const
|
||||
_Out __ofirst, _OSent __olast) const
|
||||
{
|
||||
using _OutType = remove_reference_t<iter_reference_t<_Out>>;
|
||||
if constexpr (sized_sentinel_for<_ISent, _Iter>
|
||||
@ -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));
|
||||
}
|
||||
};
|
||||
|
||||
@ -316,7 +311,7 @@ namespace ranges
|
||||
requires constructible_from<iter_value_t<_Out>, iter_reference_t<_Iter>>
|
||||
uninitialized_copy_n_result<_Iter, _Out>
|
||||
operator()(_Iter __ifirst, iter_difference_t<_Iter> __n,
|
||||
_Out __ofirst, _Sent __olast) const
|
||||
_Out __ofirst, _Sent __olast) const
|
||||
{
|
||||
using _OutType = remove_reference_t<iter_reference_t<_Out>>;
|
||||
if constexpr (sized_sentinel_for<_Sent, _Out>
|
||||
@ -353,7 +348,7 @@ namespace ranges
|
||||
iter_rvalue_reference_t<_Iter>>
|
||||
uninitialized_move_result<_Iter, _Out>
|
||||
operator()(_Iter __ifirst, _ISent __ilast,
|
||||
_Out __ofirst, _OSent __olast) const
|
||||
_Out __ofirst, _OSent __olast) const
|
||||
{
|
||||
using _OutType = remove_reference_t<iter_reference_t<_Out>>;
|
||||
if constexpr (sized_sentinel_for<_ISent, _Iter>
|
||||
@ -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));
|
||||
}
|
||||
};
|
||||
|
||||
@ -406,7 +399,7 @@ namespace ranges
|
||||
iter_rvalue_reference_t<_Iter>>
|
||||
uninitialized_move_n_result<_Iter, _Out>
|
||||
operator()(_Iter __ifirst, iter_difference_t<_Iter> __n,
|
||||
_Out __ofirst, _Sent __olast) const
|
||||
_Out __ofirst, _Sent __olast) const
|
||||
{
|
||||
using _OutType = remove_reference_t<iter_reference_t<_Out>>;
|
||||
if constexpr (sized_sentinel_for<_Sent, _Out>
|
||||
@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
@ -473,7 +465,7 @@ namespace ranges
|
||||
requires constructible_from<iter_value_t<_Iter>, const _Tp&>
|
||||
_Iter
|
||||
operator()(_Iter __first, iter_difference_t<_Iter> __n,
|
||||
const _Tp& __x) const
|
||||
const _Tp& __x) const
|
||||
{
|
||||
using _ValueType = remove_reference_t<iter_reference_t<_Iter>>;
|
||||
if constexpr (is_trivial_v<_ValueType>
|
||||
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user