Why is the concept std::integral defined as
template < class T > concept integral = std::is_integral_v<T>;
and not as
template < class T > concept integral = std::numeric_limits<T>::is_integer;
?
This means that the concept std::integral is restricted to "fundamental integral". For example, this is true:
std::numeric_limits<boost::multiprecision::cpp_int>::is_integer;
but this is false:
std::integral<boost::multiprecision::cpp_int>;
Is there any option to activate std::integral for user-defined types? What is missing e.g. in boost::multiprecision::cpp_int so that it does not fulfill the concept integral?
std::integralimplies some things thatstd::numeric_limits<...>::is_integerdoesn't, like triviality, etc. By hacking it to be true for user-defined types, you'd break those assumptions.memcpying the numbers. Also implicitly starting their lifetime.