In C++, the term arithmetic type refers to a fundamental type which is either integral or floating point.
As part of the definition of safely_constructible
,
strict_variant
makes a finer
classification of these types, and assigns a portable conversion
rank to each such type.
The type trait arithmetic_category
computes the category of a given arithmetic type.
namespace strict_variant { namespace mpl { enum class arithmetic_category : char { integer, character, wide_char, boolean, floating }; template <typename T, typename ENABLE = void> struct classify_arithmetic; } // end namespace mpl } // end namespace strict_variant
expression |
value |
---|---|
|
any arithmetic type |
|
The |
Fundmental Type |
|
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Note | |
---|---|
You are free to specialize this trait to support other arithmetic types, such as implementation-specific extended integers.
By default, any type for which |