Namespaces
Variants

std::is_arithmetic

From cppreference.com
Revision as of 15:54, 25 October 2011 by Cubbi (talk | contribs) (+mentioned conversions)

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

Template:eq fun cpp

Example

Template:example cpp

See also

checks if a type is an integral type
(class template) [edit]
checks if a type is a floating-point type
(class template) [edit]