@@ -1405,6 +1405,24 @@ namespace cppsort
1405
1405
}
1406
1406
};
1407
1407
1408
+ namespace detail
1409
+ {
1410
+ template <typename Iterator, typename ... Args>
1411
+ inline constexpr bool are_parameters_valid = false ;
1412
+
1413
+ template <typename Iterator>
1414
+ inline constexpr bool are_parameters_valid<Iterator> = true ;
1415
+
1416
+ template <typename Iterator, typename Func>
1417
+ inline constexpr bool are_parameters_valid<Iterator, Func>
1418
+ = is_projection_iterator_v<std::identity, Iterator, Func> ||
1419
+ is_projection_iterator_v<Func, Iterator, std::less<>>;
1420
+
1421
+ template <typename Iterator, typename Compare, typename Projection>
1422
+ inline constexpr bool are_parameters_valid<Iterator, Compare, Projection>
1423
+ = is_projection_iterator_v<Projection, Iterator, Compare>;
1424
+ }
1425
+
1408
1426
template <typename Sorter>
1409
1427
struct sorter_facade :
1410
1428
sorter_facade_base<Sorter>
@@ -1418,6 +1436,7 @@ namespace cppsort
1418
1436
typename ... Args
1419
1437
>
1420
1438
requires mstd::permutable<Iterator>
1439
+ && detail::are_parameters_valid<Iterator, Args...>
1421
1440
constexpr auto operator ()(this Self&& self, Iterator first, Sentinel last, Args&&... args)
1422
1441
-> decltype(std::forward<Self>(self).sorter_facade_base<Sorter>::operator()(
1423
1442
std::move (first), std::move(last), std::forward<Args>(args)...
@@ -1434,6 +1453,7 @@ namespace cppsort
1434
1453
typename ... Args
1435
1454
>
1436
1455
requires mstd::permutable<mstd::iterator_t <Range>>
1456
+ && detail::are_parameters_valid<mstd::iterator_t <Range>, Args...>
1437
1457
constexpr auto operator ()(this Self&& self, Range&& range, Args&&... args)
1438
1458
-> decltype(std::forward<Self>(self).sorter_facade_base<Sorter>::operator()(
1439
1459
std::forward<Range>(range), std::forward<Args>(args)...
0 commit comments