tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
is_integral.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_TYPE_TRAITS_IS_INTEGRAL_HPP
4#define TETL_TYPE_TRAITS_IS_INTEGRAL_HPP
5
7
8#if __has_builtin(__is_integral)
9namespace etl {
10
11template <typename T>
12struct is_integral : bool_constant<__is_integral(T)> { };
13
14template <typename T>
15
16inline constexpr bool is_integral_v = __is_integral(T);
17
18} // namespace etl
19
20#else
21
22 #include <etl/_meta/contains.hpp>
24
25namespace etl {
26// clang-format off
27template <typename T>
30 bool,
31 char,
32 signed char,
33 unsigned char,
34 wchar_t,
35 char8_t,
36 char16_t,
37 char32_t,
38 short,
39 unsigned short,
40 int,
41 unsigned int,
42 long,
43 unsigned long,
44 long long,
45 unsigned long long
46 >
47>;
48// clang-format on
49
50template <typename T>
51struct is_integral : bool_constant<is_integral_v<T> > { };
52
53} // namespace etl
54
55#endif
56
57#endif // TETL_TYPE_TRAITS_IS_INTEGRAL_HPP
constexpr auto contains_v
Definition contains.hpp:19
Definition adjacent_find.hpp:8
constexpr bool is_integral_v
Definition is_integral.hpp:28
integral_constant< bool, B > bool_constant
Definition bool_constant.hpp:11
Definition is_integral.hpp:51
Definition list.hpp:10