tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
is_const.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_CONST_HPP
5#define TETL_TYPE_TRAITS_IS_CONST_HPP
6
7#include <etl/_type_traits/bool_constant.hpp>
8
9namespace etl {
10
11/// \brief If T is a const-qualified type (that is, const, or const volatile),
12/// provides the member constant value equal to true. For any other type, value
13/// is false.
14template <typename T>
15struct is_const : false_type { };
16
17template <typename T>
18struct is_const<T const> : true_type { };
19
20template <typename T>
21inline constexpr bool is_const_v = is_const<T>::value;
22
23} // namespace etl
24
25#endif // TETL_TYPE_TRAITS_IS_CONST_HPP
Definition adjacent_find.hpp:9
constexpr bool is_const_v
Definition is_const.hpp:21
If T is a const-qualified type (that is, const, or const volatile), provides the member constant valu...
Definition is_const.hpp:15