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
9
10namespace 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
Definition adjacent_find.hpp:8