SpECTRE  v2024.04.12
tt::is_integer< I > Struct Template Reference

Check if I is an integer type (non-bool, non-character), unlike std::is_integral. More...

#include <IsInteger.hpp>

Detailed Description

template<typename I>
struct tt::is_integer< I >

Check if I is an integer type (non-bool, non-character), unlike std::is_integral.

Details

Inherits from std::true_type if I is a short, unsigned short, int, unsigned int, long, unsigned long, long long, or unsigned long long, otherwise inherits from std::false_type.

Usage

For any type I,

using result = tt::is_integer<I>;
Check if I is an integer type (non-bool, non-character), unlike std::is_integral.
Definition: IsInteger.hpp:33

Returns: std::bool_constant

Example

"Failed testing type trait is_integer");
static_assert(tt::is_integer_v<unsigned short>,
"Failed testing type trait is_integer");
static_assert(tt::is_integer_v<int>, "Failed testing type trait is_integer");
static_assert(tt::is_integer_v<unsigned int>,
"Failed testing type trait is_integer");
static_assert(tt::is_integer_v<long>, "Failed testing type trait is_integer");
static_assert(tt::is_integer_v<unsigned long>,
"Failed testing type trait is_integer");
static_assert(tt::is_integer_v<long long>,
"Failed testing type trait is_integer");
static_assert(tt::is_integer_v<unsigned long long>,
"Failed testing type trait is_integer");
static_assert(not tt::is_integer_v<bool>,
"Failed testing type trait is_integer");
static_assert(not tt::is_integer_v<char>,
"Failed testing type trait is_integer");
See also
std::is_integral std::is_arithmetic std::is_floating_point

The documentation for this struct was generated from the following file: