33
33
#include < cpp-sort/sort.h>
34
34
#include < cpp-sort/sorter_facade.h>
35
35
#include < cpp-sort/sorter_traits.h>
36
- #include " ../detail/is_callable.h"
37
- #include " ../detail/logical_traits.h"
38
36
#include " ../detail/projection_compare.h"
37
+ #include " ../detail/type_traits.h"
39
38
40
39
namespace cppsort
41
40
{
@@ -76,34 +75,34 @@ namespace cppsort
76
75
template <typename Sorter, typename Iterable>
77
76
struct can_sort :
78
77
conjunction<
79
- is_callable <adl_despair( Sorter, Iterable&) >,
80
- negation<is_callable< adl_despair( Sorter, Iterable&), nope_type >>
78
+ is_invocable <adl_despair, Sorter, Iterable&>,
79
+ negation<is_invocable_r<nope_type, adl_despair, Sorter, Iterable&>>
81
80
>
82
81
{};
83
82
84
83
template <typename Sorter, typename Iterable, typename Compare>
85
84
struct can_comparison_sort :
86
85
conjunction<
87
- is_callable <adl_despair( Sorter, Iterable&, Compare) >,
88
- negation<is_callable< adl_despair( Sorter, Iterable&, Compare), nope_type >>,
86
+ is_invocable <adl_despair, Sorter, Iterable&, Compare>,
87
+ negation<is_invocable_r<nope_type, adl_despair, Sorter, Iterable&, Compare>>,
89
88
is_projection<utility::identity, Iterable, Compare>
90
89
>
91
90
{};
92
91
93
92
template <typename Sorter, typename Iterable, typename Projection>
94
93
struct can_projection_sort :
95
94
conjunction<
96
- is_callable <adl_despair( Sorter, Iterable&, Projection) >,
97
- negation<is_callable< adl_despair( Sorter, Iterable&, Projection), nope_type >>,
95
+ is_invocable <adl_despair, Sorter, Iterable&, Projection>,
96
+ negation<is_invocable_r<nope_type, adl_despair, Sorter, Iterable&, Projection>>,
98
97
is_projection<Projection, Iterable>
99
98
>
100
99
{};
101
100
102
101
template <typename Sorter, typename Iterable, typename Compare, typename Projection>
103
102
struct can_comparison_projection_sort :
104
103
conjunction<
105
- is_callable <adl_despair( Sorter, Iterable&, Compare, Projection) >,
106
- negation<is_callable< adl_despair( Sorter, Iterable&, Compare, Projection), nope_type >>,
104
+ is_invocable <adl_despair, Sorter, Iterable&, Compare, Projection>,
105
+ negation<is_invocable_r<nope_type, adl_despair, Sorter, Iterable&, Compare, Projection>>,
107
106
is_projection<Projection, Iterable, Compare>
108
107
>
109
108
{};
@@ -118,7 +117,7 @@ namespace cppsort
118
117
auto operator ()(Iterable& iterable) const
119
118
-> std::enable_if_t<
120
119
detail::can_sort<Sorter, Iterable>::value,
121
- std:: conditional_t<
120
+ conditional_t<
122
121
Stability,
123
122
std::false_type,
124
123
decltype(detail::adl_despair{}(Sorter{}, iterable))
@@ -135,7 +134,7 @@ namespace cppsort
135
134
auto operator ()(Iterable& iterable) const
136
135
-> std::enable_if_t<
137
136
not detail::can_sort<Sorter, Iterable>::value,
138
- std:: conditional_t<
137
+ conditional_t<
139
138
Stability,
140
139
cppsort::is_stable<Sorter(Iterable&)>,
141
140
decltype(cppsort::sort(Sorter{}, iterable))
@@ -153,7 +152,7 @@ namespace cppsort
153
152
auto operator ()(Iterable& iterable, Compare compare) const
154
153
-> std::enable_if_t<
155
154
detail::can_comparison_sort<Sorter, Iterable, Compare>::value,
156
- std:: conditional_t<
155
+ conditional_t<
157
156
Stability,
158
157
std::false_type,
159
158
decltype(detail::adl_despair{}(Sorter{}, iterable, std::move(compare)))
@@ -172,7 +171,7 @@ namespace cppsort
172
171
-> std::enable_if_t<
173
172
not is_projection<Compare, Iterable>::value &&
174
173
not detail::can_comparison_sort<Sorter, Iterable, Compare>::value,
175
- std:: conditional_t<
174
+ conditional_t<
176
175
Stability,
177
176
cppsort::is_stable<Sorter(Iterable&, Compare)>,
178
177
decltype(cppsort::sort(Sorter{}, iterable, std::move(compare)))
@@ -191,7 +190,7 @@ namespace cppsort
191
190
-> std::enable_if_t<
192
191
not detail::can_comparison_sort<Sorter, Iterable, Projection>::value &&
193
192
detail::can_projection_sort<Sorter, Iterable, Projection>::value,
194
- std:: conditional_t<
193
+ conditional_t<
195
194
Stability,
196
195
std::false_type,
197
196
decltype(detail::adl_despair{}(Sorter{}, iterable, std::move(projection)))
@@ -210,7 +209,7 @@ namespace cppsort
210
209
-> std::enable_if_t<
211
210
not detail::can_projection_sort<Sorter, Iterable, Projection>::value &&
212
211
detail::can_comparison_projection_sort<Sorter, Iterable, std::less<>, Projection>::value,
213
- std:: conditional_t<
212
+ conditional_t<
214
213
Stability,
215
214
std::false_type,
216
215
decltype(detail::adl_despair{}(Sorter{}, iterable,
@@ -236,7 +235,7 @@ namespace cppsort
236
235
Iterable,
237
236
detail::projection_compare<std::less<>, Projection>
238
237
>::value,
239
- std:: conditional_t<
238
+ conditional_t<
240
239
Stability,
241
240
std::false_type,
242
241
decltype(detail::adl_despair{}(Sorter{}, iterable,
@@ -265,7 +264,7 @@ namespace cppsort
265
264
Iterable,
266
265
detail::projection_compare<std::less<>, Projection>
267
266
>::value,
268
- std:: conditional_t<
267
+ conditional_t<
269
268
Stability,
270
269
cppsort::is_stable<Sorter(Iterable&, Projection)>,
271
270
decltype(cppsort::sort(Sorter{}, iterable, std::move(projection)))
@@ -284,7 +283,7 @@ namespace cppsort
284
283
auto operator ()(Iterable& iterable, Compare compare, Projection projection) const
285
284
-> std::enable_if_t<
286
285
detail::can_comparison_projection_sort<Sorter, Iterable, Compare, Projection>::value,
287
- std:: conditional_t<
286
+ conditional_t<
288
287
Stability,
289
288
std::false_type,
290
289
decltype(detail::adl_despair{}(Sorter{}, iterable,
@@ -310,7 +309,7 @@ namespace cppsort
310
309
Iterable,
311
310
detail::projection_compare<Compare, Projection>
312
311
>::value,
313
- std:: conditional_t<
312
+ conditional_t<
314
313
Stability,
315
314
std::false_type,
316
315
decltype(detail::adl_despair{}(Sorter{}, iterable,
@@ -338,7 +337,7 @@ namespace cppsort
338
337
Iterable,
339
338
detail::projection_compare<Compare, Projection>
340
339
>::value,
341
- std:: conditional_t<
340
+ conditional_t<
342
341
Stability,
343
342
cppsort::is_stable<Sorter(Iterable&, Compare, Projection)>,
344
343
decltype(cppsort::sort(Sorter{}, iterable,
@@ -360,7 +359,7 @@ namespace cppsort
360
359
container_aware_adapter () = default ;
361
360
362
361
// Automatic deduction guide
363
- constexpr container_aware_adapter (Sorter) noexcept {}
362
+ constexpr explicit container_aware_adapter (Sorter) noexcept {}
364
363
};
365
364
366
365
// //////////////////////////////////////////////////////////
0 commit comments