cmcstl2 defines integral as:
namespace ext {
template<class T>
concept scalar = std::is_scalar_v<T> && regular<T>;
template<class T>
concept arithmetic = std::is_arithmetic_v<T> && scalar<T> && totally_ordered<T>;
template<class T>
concept floating_point = std::is_floating_point_v<T> && arithmetic<T>;
} // namespace ext
template<class T>
concept integral = std::is_integral_v<T> && ext::arithmetic<T>;
(snake_casing mine)
I think making this standard instead of an extension is probably a Good Thing™️, since our canonical example for regular are the integral types... which don't refine regular, which makes this ambiguous.
template<std::regular T>
void pick_me(T) {}
template<std::integral T>
void pick_me(T) {}
template<std::floating_point T>
void pick_me(T) {}
int main()
{
pick_me(0);
pick_me(0.0);
}
cmcstl2 defines
integralas:(
snake_casingmine)I think making this standard instead of an extension is probably a Good Thing™️, since our canonical example for
regularare the integral types... which don't refine regular, which makes this ambiguous.