8#ifndef INCLUDED_BSLALG_SYNTHTHREEWAYUTIL
9#define INCLUDED_BSLALG_SYNTHTHREEWAYUTIL
111#include <bslscm_version.h>
116#if defined(BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON) && \
117 defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS)
119#define BSLALG_SYNTHTHREEWAYUTIL_AVAILABLE 1
136struct SynthThreeWayUtil {
149 template <
class t_TYPE1,
class t_TYPE2>
150 static constexpr bool isNoexcept(
const t_TYPE1 *t1 =
nullptr,
151 const t_TYPE2 *t2 =
nullptr)
153 if constexpr (std::three_way_comparable_with<t_TYPE1, t_TYPE2>)
154 return noexcept(*t1 <=> *t2);
156 return noexcept(*t1 < *t2) &&
noexcept(*t2 < *t1);
159 template <
class t_TYPE1,
class t_TYPE2>
161 constexpr auto operator()(
const t_TYPE1& t1,
const t_TYPE2& t2)
const
162 noexcept(isNoexcept<t_TYPE1, t_TYPE2>())
164 { t1 < t2 } -> bslmf::BooleanTestable;
165 { t2 < t1 } -> bslmf::BooleanTestable;
168 if constexpr (std::three_way_comparable_with<t_TYPE1, t_TYPE2>)
173 return std::weak_ordering::less;
175 return std::weak_ordering::greater;
177 return std::weak_ordering::equivalent;
187 template <
class t_TYPE1,
class t_TYPE2 = t_TYPE1>
188 using Result =
decltype(compare(std::declval<t_TYPE1&>(),
189 std::declval<t_TYPE2&>()));
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition bdlc_flathashmap.h:2218