@@ -21,9 +21,9 @@ concept statically_castable = requires(SrcRep value) {
2121
2222template <typename DestRep, typename SrcRep>
2323concept builtin_numeric_pair =
24- numeric_underlying_type <DestRep> && numeric_underlying_type <SrcRep>;
24+ std_numeric <DestRep> && std_numeric <SrcRep>;
2525
26- template <integer_underlying_type DestRep, integer_underlying_type SrcRep>
26+ template <std_integer DestRep, std_integer SrcRep>
2727constexpr auto numeric_risk (SrcRep value)
2828 -> std::optional<risk::kind> {
2929 using dest_type = std::remove_cvref_t <DestRep>;
@@ -62,7 +62,7 @@ constexpr auto numeric_risk(SrcRep value)
6262 }
6363}
6464
65- template <integer_underlying_type DestRep, floating_underlying_type SrcRep>
65+ template <std_integer DestRep, std_floating SrcRep>
6666constexpr auto numeric_risk (SrcRep value)
6767 -> std::optional<risk::kind> {
6868 using dest_type = std::remove_cvref_t <DestRep>;
@@ -91,7 +91,7 @@ constexpr auto numeric_risk(SrcRep value)
9191 return std::nullopt ;
9292}
9393
94- template <floating_underlying_type DestRep, integer_underlying_type SrcRep>
94+ template <std_floating DestRep, std_integer SrcRep>
9595constexpr auto numeric_risk (SrcRep value)
9696 -> std::optional<risk::kind> {
9797 using dest_type = std::remove_cvref_t <DestRep>;
@@ -111,7 +111,7 @@ constexpr auto numeric_risk(SrcRep value)
111111 return std::nullopt ;
112112}
113113
114- template <floating_underlying_type DestRep, floating_underlying_type SrcRep>
114+ template <std_floating DestRep, std_floating SrcRep>
115115constexpr auto numeric_risk (SrcRep value)
116116 -> std::optional<risk::kind> {
117117 using dest_type = std::remove_cvref_t <DestRep>;
@@ -200,8 +200,7 @@ constexpr auto truncating_rep_cast(SrcRep value) noexcept
200200 using dest_type = std::remove_cvref_t <DestRep>;
201201 using src_type = std::remove_cvref_t <SrcRep>;
202202
203- if constexpr (integer_underlying_type<dest_type> &&
204- floating_underlying_type<src_type>) {
203+ if constexpr (std_integer<dest_type> && std_floating<src_type>) {
205204 if (std::isnan (value)) {
206205 return dest_type{};
207206 }
@@ -280,25 +279,25 @@ constexpr auto cast_underlying_result(Src value, RepCaster rep_caster)
280279
281280export namespace mcpplibs ::primitives::conversion {
282281
283- template <integer_underlying_type DestRep, integer_underlying_type SrcRep>
282+ template <std_integer DestRep, std_integer SrcRep>
284283constexpr auto numeric_risk (SrcRep value)
285284 -> std::optional<risk::kind> {
286285 return details::numeric_risk<DestRep>(value);
287286}
288287
289- template <integer_underlying_type DestRep, floating_underlying_type SrcRep>
288+ template <std_integer DestRep, std_floating SrcRep>
290289constexpr auto numeric_risk (SrcRep value)
291290 -> std::optional<risk::kind> {
292291 return details::numeric_risk<DestRep>(value);
293292}
294293
295- template <floating_underlying_type DestRep, integer_underlying_type SrcRep>
294+ template <std_floating DestRep, std_integer SrcRep>
296295constexpr auto numeric_risk (SrcRep value)
297296 -> std::optional<risk::kind> {
298297 return details::numeric_risk<DestRep>(value);
299298}
300299
301- template <floating_underlying_type DestRep, floating_underlying_type SrcRep>
300+ template <std_floating DestRep, std_floating SrcRep>
302301constexpr auto numeric_risk (SrcRep value)
303302 -> std::optional<risk::kind> {
304303 return details::numeric_risk<DestRep>(value);
0 commit comments