scalar type

a scalar is a fundamental except it cannot be void, but it can be a pointer type, or an enum type.
And a fundamental has a keyword in the language.
template< class T >
struct is_scalar : std::integral_constant<bool,
                     std::is_arithmetic<T>::value     ||
                     std::is_enum<T>::value           ||
                     std::is_pointer<T>::value        ||
                     std::is_member_pointer<T>::value ||
                     std::is_null_pointer<T>::value> {};


Type Classification

What is a scalar Object in C++?



You may use braced initializer lists

value initialization

最后修改于 2019-03-12

- 目录 -