-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathIsArithmetic.h
27 lines (23 loc) · 1.3 KB
/
IsArithmetic.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#pragma once
#include "inc.h"
template <typename T>
struct TIsArithmetic
{
enum { Value = false };
};
template <> struct TIsArithmetic<float> { enum { Value = true }; };
template <> struct TIsArithmetic<double> { enum { Value = true }; };
template <> struct TIsArithmetic<long double> { enum { Value = true }; };
template <> struct TIsArithmetic<uint8> { enum { Value = true }; };
template <> struct TIsArithmetic<uint16> { enum { Value = true }; };
template <> struct TIsArithmetic<uint32> { enum { Value = true }; };
template <> struct TIsArithmetic<uint64> { enum { Value = true }; };
template <> struct TIsArithmetic<char> { enum { Value = true }; };
template <> struct TIsArithmetic<short int> { enum { Value = true }; };
template <> struct TIsArithmetic<int32> { enum { Value = true }; };
template <> struct TIsArithmetic<int64> { enum { Value = true }; };
template <> struct TIsArithmetic<bool> { enum { Value = true }; };
template <> struct TIsArithmetic<wchar_t> { enum { Value = true }; };
template <typename T> struct TIsArithmetic<const T> { enum { Value = TIsArithmetic<T>::Value }; };
template <typename T> struct TIsArithmetic< volatile T> { enum { Value = TIsArithmetic<T>::Value }; };
template <typename T> struct TIsArithmetic<const volatile T> { enum { Value = TIsArithmetic<T>::Value }; };