tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
is_signed.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_TYPE_TRAITS_IS_SIGNED_HPP
4#define TETL_TYPE_TRAITS_IS_SIGNED_HPP
5
9
10namespace etl {
11
12namespace detail {
13template <typename T>
14struct is_signed : false_type { };
15
16template <typename T>
17 requires is_arithmetic_v<T>
18struct is_signed<T> : bool_constant<T(-1) < T(0)> { };
19
20} // namespace detail
21
26template <typename T>
27struct is_signed : detail::is_signed<remove_cv_t<T>>::type { };
28
29template <typename T>
30inline constexpr bool is_signed_v = is_signed<T>::value;
31
32} // namespace etl
33
34#endif // TETL_TYPE_TRAITS_IS_SIGNED_HPP
Definition adjacent_find.hpp:8
constexpr bool is_arithmetic_v
Definition is_arithmetic.hpp:21
integral_constant< bool, B > bool_constant
Definition bool_constant.hpp:11
bool_constant< false > false_type
Definition bool_constant.hpp:14