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?
Yes; that's what
std::integralis for: telling you if a type is an integral type as defined by the standard.If you want "integer type as defined by
numeric_limits" or something else, you're going to need a different definition and therefore a different concept.