tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
is_reference.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_REFERENCE_HPP
5#define TETL_TYPE_TRAITS_IS_REFERENCE_HPP
6
7#include <etl/_type_traits/bool_constant.hpp>
8
9namespace etl {
10
11/// \brief If T is a reference type (lvalue reference or rvalue reference),
12/// provides the member constant value equal true. For any other type, value is
13/// false. The behavior of a program that adds specializations for is_reference
14/// or is_reference_v is undefined.
15template <typename T>
16struct is_reference : false_type { };
17
18template <typename T>
19struct is_reference<T&> : true_type { };
20
21template <typename T>
22struct is_reference<T&&> : true_type { };
23
24template <typename T>
25inline constexpr bool is_reference_v = is_reference<T>::value;
26
27} // namespace etl
28
29#endif // TETL_TYPE_TRAITS_IS_REFERENCE_HPP
Definition adjacent_find.hpp:9
constexpr bool is_reference_v
Definition is_reference.hpp:25