tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
is_unsigned.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_TYPE_TRAITS_IS_UNSIGNED_HPP
4#define TETL_TYPE_TRAITS_IS_UNSIGNED_HPP
5
9
10namespace etl {
11
12namespace detail {
13
14template <typename T>
15struct is_unsigned : false_type { };
16
17template <typename T>
18 requires is_arithmetic_v<T>
19struct is_unsigned<T> : bool_constant<T(0) < T(-1)> { };
20
21} // namespace detail
22
29template <typename T>
30struct is_unsigned : detail::is_unsigned<remove_cv_t<T>>::type { };
31
32template <typename T>
33inline constexpr bool is_unsigned_v = is_unsigned<T>::value;
34
35} // namespace etl
36
37#endif // TETL_TYPE_TRAITS_IS_UNSIGNED_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