tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
is_member_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_MEMBER_POINTER_HPP
5#define TETL_TYPE_TRAITS_IS_MEMBER_POINTER_HPP
6
7#include <etl/_config/all.hpp>
8
9#include <etl/_type_traits/bool_constant.hpp>
10#include <etl/_type_traits/remove_cv.hpp>
11
12namespace etl {
13
14#if defined(TETL_COMPILER_CLANG)
15
16template <typename T>
17inline constexpr bool is_member_pointer_v = __is_member_pointer(T);
18
19template <typename T>
20struct is_member_pointer : bool_constant<__is_member_pointer(T)> { };
21
22#else
23
24namespace detail {
25template <typename T>
27
28template <typename T, typename U>
29struct is_member_pointer_helper<T U::*> : true_type { };
30} // namespace detail
31
32/// \brief If T is pointer to non-static member object or a pointer to
33/// non-static member function, provides the member constant value equal true.
34/// For any other type, value is false. The behavior of a program that adds
35/// specializations for is_member_pointer or is_member_pointer_v (since C++17)
36/// is undefined.
37template <typename T>
39
40template <typename T>
41inline constexpr bool is_member_pointer_v = is_member_pointer<T>::value;
42
43#endif
44
45} // namespace etl
46
47#endif // TETL_TYPE_TRAITS_IS_MEMBER_POINTER_HPP
Definition adjacent_find.hpp:9