std::is_arithmetic
From cppreference.com
Template:cpp/types/sidebar Template:ddcl list begin
Defined in header
<type_traits>
template< class T >
struct is_arithmetic;
Template:mark c++11 feature
Template:ddcl list end
If T is an arithmetic type (that is, an integral type or a floating-point type), provides the member constant value equal Template:cpp. For any other type, value is Template:cpp.
Inherited from std::integral_constant
Member constants
value [static] |
true if T is an arithmetic type , false otherwise (public static member constant) |
Member functions
operator bool |
converts the object to bool, returns value (public member function) |
operator() (C++14) |
returns value (public member function) |
Member types
| Type | Definition |
value_type
|
bool
|
type
|
std::integral_constant<bool, value>
|
Notes
Arithmetic types are the types for which the built-in arithmetic operators (+, -, *, /) are defined (possibly in combination with the usual arithmetic conversions)
Specializations of Template:cpp are provided for all arithmetic types.
Equivalent definition
Example
See also
(C++11) |
checks if a type is an integral type (class template) |
(C++11) |
checks if a type is a floating-point type (class template) |