tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
is_pointer.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_POINTER_HPP
5#define TETL_TYPE_TRAITS_IS_POINTER_HPP
6
7#include <etl/_type_traits/bool_constant.hpp>
8#include <etl/_type_traits/remove_cv.hpp>
9
10namespace etl {
11
12namespace detail {
13template <typename T>
14struct is_pointer : etl::false_type { };
15
16template <typename T>
17struct is_pointer<T*> : etl::true_type { };
18} // namespace detail
19
20/// \brief Checks whether T is a pointer to object or a pointer to function (but
21/// not a pointer to member/member function). Provides the member constant value
22/// which is equal to true, if T is a object/function pointer type. Otherwise,
23/// value is equal to false.
24///
25/// \details The behavior of a program that adds specializations for is_pointer
26/// or is_pointer_v is undefined.
27template <typename T>
28struct is_pointer : etl::detail::is_pointer<etl::remove_cv_t<T>> { };
29
30template <typename T>
31inline constexpr bool is_pointer_v = is_pointer<T>::value;
32
33} // namespace etl
34
35#endif // TETL_TYPE_TRAITS_IS_POINTER_HPP
Definition adjacent_find.hpp:9
constexpr bool is_pointer_v
Definition is_pointer.hpp:31