tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
remove_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_REMOVE_POINTER_HPP
5#define TETL_TYPE_TRAITS_REMOVE_POINTER_HPP
6
7namespace etl {
8
9/// \brief Provides the member typedef type which is the type pointed to by T,
10/// or, if T is not a pointer, then type is the same as T. The behavior of a
11/// program that adds specializations for remove_pointer is undefined.
12/// \ingroup type_traits
13template <typename T>
15 using type = T;
16};
17
18template <typename T>
19struct remove_pointer<T*> {
20 using type = T;
21};
22
23template <typename T>
24struct remove_pointer<T* const> {
25 using type = T;
26};
27
28template <typename T>
29struct remove_pointer<T* volatile> {
30 using type = T;
31};
32
33template <typename T>
34struct remove_pointer<T* const volatile> {
35 using type = T;
36};
37
38template <typename T>
39using remove_pointer_t = typename remove_pointer<T>::type;
40
41} // namespace etl
42
43#endif // TETL_TYPE_TRAITS_REMOVE_POINTER_HPP
Definition adjacent_find.hpp:9
Provides the member typedef type which is the type pointed to by T, or, if T is not a pointer,...
Definition remove_pointer.hpp:14