tetl
0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
is_scalar.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: BSL-1.0
2
3
#ifndef TETL_TYPE_TRAITS_IS_SCALAR_HPP
4
#define TETL_TYPE_TRAITS_IS_SCALAR_HPP
5
6
#include <
etl/_config/all.hpp
>
7
8
#include <
etl/_type_traits/bool_constant.hpp
>
9
#include <
etl/_type_traits/is_arithmetic.hpp
>
10
#include <
etl/_type_traits/is_enum.hpp
>
11
#include <
etl/_type_traits/is_member_pointer.hpp
>
12
#include <
etl/_type_traits/is_null_pointer.hpp
>
13
#include <
etl/_type_traits/is_pointer.hpp
>
14
15
namespace
etl
{
16
20
template
<
typename
T>
21
struct
is_scalar
;
22
23
#if __has_builtin(__is_scalar)
24
25
template
<
typename
T>
26
struct
is_scalar
:
bool_constant
<__is_scalar(T)> { };
27
28
template
<
typename
T>
29
30
inline
constexpr
bool
is_scalar_v
= __is_scalar(T);
31
#else
32
33
template
<
typename
T>
34
struct
is_scalar
35
:
bool_constant
<
36
is_arithmetic_v<T> or is_enum_v<T> or is_pointer_v<T> or is_member_pointer_v<T> or is_null_pointer_v<T> > { };
37
38
template
<
typename
T>
39
40
inline
constexpr
bool
is_scalar_v
=
is_scalar<T>::value
;
41
42
#endif
43
44
}
// namespace etl
45
46
#endif
// TETL_TYPE_TRAITS_IS_SCALAR_HPP
all.hpp
bool_constant.hpp
is_arithmetic.hpp
is_enum.hpp
is_member_pointer.hpp
is_null_pointer.hpp
is_pointer.hpp
etl
Definition
adjacent_find.hpp:8
etl::is_scalar_v
constexpr bool is_scalar_v
Definition
is_scalar.hpp:40
etl::bool_constant
integral_constant< bool, B > bool_constant
Definition
bool_constant.hpp:11
etl::integral_constant< bool, B >::value
static constexpr bool value
Definition
integral_constant.hpp:10
etl::is_scalar
If T is a scalar type (that is a possibly cv-qualified arithmetic, pointer, pointer to member,...
Definition
is_scalar.hpp:36
include
etl
_type_traits
is_scalar.hpp
Generated on Sat Mar 8 2025 16:19:59 for tetl by
1.14.0