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
// SPDX-FileCopyrightText: Copyright (C) 2019 Tobias Hienzsch
3
4
#
ifndef
TETL_TYPE_TRAITS_IS_SCALAR_HPP
5
#
define
TETL_TYPE_TRAITS_IS_SCALAR_HPP
6
7
#
include
<
etl
/
_config
/
all
.
hpp
>
8
9
#
include
<
etl
/
_type_traits
/
bool_constant
.
hpp
>
10
#
include
<
etl
/
_type_traits
/
is_arithmetic
.
hpp
>
11
#
include
<
etl
/
_type_traits
/
is_enum
.
hpp
>
12
#
include
<
etl
/
_type_traits
/
is_member_pointer
.
hpp
>
13
#
include
<
etl
/
_type_traits
/
is_null_pointer
.
hpp
>
14
#
include
<
etl
/
_type_traits
/
is_pointer
.
hpp
>
15
16
namespace
etl
{
17
18
/// \brief If T is a scalar type (that is a possibly cv-qualified arithmetic,
19
/// pointer, pointer to member, enumeration, or etl::nullptr_t type), provides
20
/// the member constant value equal true. For any other type, value is false.
21
template
<
typename
T>
22
struct
is_scalar;
23
24
#
if
__has_builtin
(
__is_scalar
)
25
26
template
<
typename
T>
27
struct
is_scalar : bool_constant<
__is_scalar
(T)> { };
28
29
template
<
typename
T>
30
31
inline
constexpr
bool
is_scalar_v =
__is_scalar
(T);
32
#
else
33
34
template
<
typename
T
>
35
struct
is_scalar
36
:
bool_constant
<
37
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
>
38
> { };
39
40
template
<
typename
T
>
41
42
inline
constexpr
bool
is_scalar_v
=
is_scalar
<
T
>::
value
;
43
44
#
endif
45
46
}
// namespace etl
47
48
#
endif
// TETL_TYPE_TRAITS_IS_SCALAR_HPP
etl
Definition
adjacent_find.hpp:9
include
etl
_type_traits
is_scalar.hpp
Generated on Sun Sep 7 2025 19:15:18 for tetl by
1.9.8