10
10
11
11
namespace stdsharp
12
12
{
13
- inline constexpr auto set_if = []<typename T, typename U, :: std::predicate<U, T> Comp>
14
- requires :: std::assignable_from<T&, U> // clang-format off
13
+ inline constexpr auto set_if = []<typename T, typename U, std::predicate<U, T> Comp>
14
+ requires std::assignable_from<T&, U> // clang-format off
15
15
(T& left, U&& right, Comp comp = {})
16
16
noexcept (nothrow_predicate<Comp, U, T> && nothrow_assignable_from<T&, U>)
17
17
-> T& // clang-format on
18
18
{
19
- if (:: std::invoke (cpp_move (comp), right, left)) left = cpp_forward (right);
19
+ if (std::invoke (cpp_move (comp), right, left)) left = cpp_forward (right);
20
20
return left;
21
21
};
22
22
23
23
using set_if_fn = decltype (set_if);
24
24
25
25
inline constexpr auto set_if_greater = []<typename T, typename U>
26
- requires :: std::invocable<set_if_fn, T&, U, :: std::ranges::greater> // clang-format off
26
+ requires std::invocable<set_if_fn, T&, U, std::ranges::greater> // clang-format off
27
27
(T & left, U && right)
28
- noexcept (nothrow_invocable<set_if_fn, T&, U, :: std::ranges::greater>) -> T& // clang-format on
28
+ noexcept (nothrow_invocable<set_if_fn, T&, U, std::ranges::greater>) -> T& // clang-format on
29
29
{
30
30
return set_if (left, cpp_forward (right), greater_v);
31
31
};
32
32
33
33
using set_if_greater_fn = decltype (set_if_greater);
34
34
35
35
inline constexpr auto set_if_less = []<typename T, typename U>
36
- requires :: std::invocable<set_if_fn, T&, U, :: std::ranges::less> // clang-format off
36
+ requires std::invocable<set_if_fn, T&, U, std::ranges::less> // clang-format off
37
37
(T& left, U&& right)
38
- noexcept (nothrow_invocable<set_if_fn, T&, U, :: std::ranges::less>) -> T& // clang-format on
38
+ noexcept (nothrow_invocable<set_if_fn, T&, U, std::ranges::less>) -> T& // clang-format on
39
39
{
40
40
return set_if (left, cpp_forward (right), less_v);
41
41
};
@@ -46,9 +46,9 @@ namespace stdsharp
46
46
{
47
47
template <
48
48
typename T,
49
- typename Proj = :: std::identity,
50
- :: std::indirect_strict_weak_order<:: std::projected<const T*, Proj>> Compare =
51
- :: std::ranges::less // clang-format off
49
+ typename Proj = std::identity,
50
+ std::indirect_strict_weak_order<std::projected<const T*, Proj>> Compare =
51
+ std::ranges::less // clang-format off
52
52
> // clang-format on
53
53
[[nodiscard]] constexpr auto operator ()( // NOLINTBEGIN(*-easily-swappable-parameters)
54
54
const T& t,
@@ -61,33 +61,33 @@ namespace stdsharp
61
61
!is_debug ||
62
62
nothrow_predicate<
63
63
Compare,
64
- :: std::projected<const T*, Proj>,
65
- :: std::projected<const T*, Proj> // clang-format off
64
+ std::projected<const T*, Proj>,
65
+ std::projected<const T*, Proj> // clang-format off
66
66
> // clang-format on
67
67
)
68
68
{
69
- const auto & proj_max = :: std::invoke (proj, max);
70
- const auto & proj_min = :: std::invoke (proj, min);
71
- const auto & proj_t = :: std::invoke (proj, t);
69
+ const auto & proj_max = std::invoke (proj, max);
70
+ const auto & proj_min = std::invoke (proj, min);
71
+ const auto & proj_t = std::invoke (proj, t);
72
72
73
- precondition<:: std::invalid_argument>(
74
- [&] { return !:: std::invoke (cmp, proj_max, proj_min); },
73
+ precondition<std::invalid_argument>(
74
+ [&] { return !std::invoke (cmp, proj_max, proj_min); },
75
75
" max value should not less than min value"
76
76
);
77
77
78
- return !:: std::invoke (cmp, proj_t , proj_min) && !:: std::invoke (cmp, proj_max, proj_t );
78
+ return !std::invoke (cmp, proj_t , proj_min) && !std::invoke (cmp, proj_max, proj_t );
79
79
}
80
80
} is_between{};
81
81
82
82
constexpr struct strict_compare_fn
83
83
{
84
- template <:: std::ranges::input_range TRng, :: std::ranges::input_range URng>
85
- requires :: std::three_way_comparable_with<
84
+ template <std::ranges::input_range TRng, std::ranges::input_range URng>
85
+ requires std::three_way_comparable_with<
86
86
range_const_reference_t <TRng>,
87
87
range_const_reference_t <URng>>
88
88
constexpr auto operator ()(const TRng& left, const URng& right) const
89
89
{
90
- using ordering = :: std::partial_ordering;
90
+ using ordering = std::partial_ordering;
91
91
92
92
auto pre = ordering::equivalent;
93
93
const auto cmp_impl = [](ordering& pre, const ordering next)
@@ -106,10 +106,10 @@ namespace stdsharp
106
106
};
107
107
108
108
{
109
- auto l_it = :: std::ranges::cbegin (left);
110
- auto r_it = :: std::ranges::cbegin (right);
111
- const auto l_end = :: std::ranges::cend (left);
112
- const auto r_end = :: std::ranges::cend (right);
109
+ auto l_it = std::ranges::cbegin (left);
110
+ auto r_it = std::ranges::cbegin (right);
111
+ const auto l_end = std::ranges::cend (left);
112
+ const auto r_end = std::ranges::cend (right);
113
113
for (; !is_ud (pre); ++l_it, ++r_it)
114
114
{
115
115
if (l_it == l_end)
@@ -124,7 +124,7 @@ namespace stdsharp
124
124
break ;
125
125
}
126
126
127
- cmp_impl (pre, :: std::compare_three_way{}(*l_it, *r_it));
127
+ cmp_impl (pre, std::compare_three_way{}(*l_it, *r_it));
128
128
}
129
129
}
130
130
0 commit comments