tetl
0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
synth_three_way.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: BSL-1.0
2
3
#ifndef TETL_COMPARE_SYNTH_THREE_WAY_HPP
4
#define TETL_COMPARE_SYNTH_THREE_WAY_HPP
5
6
#include <
etl/_compare/weak_ordering.hpp
>
7
#include <
etl/_concepts/boolean_testable.hpp
>
8
#include <
etl/_type_traits/declval.hpp
>
9
10
namespace
etl
{
11
12
// // clang-format off
13
// inline constexpr auto synth_three_way =
14
// []<typename T, typename U>(T const& t, U const& u)
15
// requires requires {
16
// { t < u } -> boolean_testable;
17
// { u < t } -> boolean_testable;
18
// }
19
// {
20
// if constexpr (three_way_comparable_with<T, U>) {
21
// return t <=> u;
22
// } else {
23
// if (t < u) { return weak_ordering::less; }
24
// if (u < t) { return weak_ordering::greater; }
25
// return weak_ordering::equivalent;
26
// }
27
// };
28
// // clang-format on
29
30
// template <typename T, typename U = T>
31
// using synth_three_way_result
32
// = decltype(synth_three_way(declval<T&>(), declval<U&>()));
33
34
}
// namespace etl
35
36
#endif
// TETL_COMPARE_SYNTH_THREE_WAY_HPP
boolean_testable.hpp
declval.hpp
etl
Definition
adjacent_find.hpp:8
weak_ordering.hpp
include
etl
_compare
synth_three_way.hpp
Generated on Sat Mar 8 2025 16:19:59 for tetl by
1.14.0