You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// "No safe 'as' cast available - if this is narrowing and you're sure the conversion is safe, consider using `unsafe_narrow<T>()` to force the conversion"
715
+
// );
706
716
return nonesuch;
707
717
}
708
718
719
+
// For literals we can check for safe 'narrowing' at a compile time
720
+
template< typename C, auto x >
721
+
inlineconstexprbool is_castable_v =
722
+
std::is_arithmetic_v<C> &&
723
+
std::is_arithmetic_v<CPP2_TYPEOF(x)> &&
724
+
!(static_cast<CPP2_TYPEOF(x)>(static_cast<C>(x)) != x ||
"No safe 'as' cast available - if this is narrowing and you're sure the conversion is safe, consider using `unsafe_narrow<T>()` to force the conversion"
"No safe 'as' cast available - if this is narrowing and you're sure the conversion is safe, consider using `unsafe_narrow<T>()` to force the conversion"
0 commit comments