ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkIsNumber.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18
19#ifndef itkIsNumber_h
20#define itkIsNumber_h
21
22#include "itkMacro.h"
23
24#if !defined(ITK_LEGACY_REMOVE)
25
27# include "itkIntTypes.h"
28
29
31namespace itk::mpl
32{
39template <typename T>
40struct IsNumber : FalseType
41{};
42
44template <>
45struct IsNumber<unsigned char> : TrueType
46{};
47template <>
48struct IsNumber<signed char> : TrueType
49{};
50template <>
51struct IsNumber<unsigned short> : TrueType
52{};
53template <>
54struct IsNumber<short> : TrueType
55{};
56template <>
57struct IsNumber<int> : TrueType
58{};
59template <>
60struct IsNumber<unsigned int> : TrueType
61{};
62template <>
63struct IsNumber<long> : TrueType
64{};
65template <>
66struct IsNumber<unsigned long> : TrueType
67{};
68template <>
69struct IsNumber<long long> : TrueType
70{};
71template <>
72struct IsNumber<unsigned long long> : TrueType
73{};
74template <>
75struct IsNumber<float> : TrueType
76{};
77template <>
78struct IsNumber<double> : TrueType
79{};
80template <>
81struct IsNumber<long double> : TrueType
82{};
84
85} // namespace itk::mpl
87
88#else // ITK_LEGACY_REMOVE
89# error Use std::is_arithmetic from <type_traits> directly
90#endif
91
92#endif // itkIsNumber_h