tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
remove_extent.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_EXTENT_HPP
5#define TETL_TYPE_TRAITS_REMOVE_EXTENT_HPP
6
7#include <etl/_cstddef/size_t.hpp>
8
9namespace etl {
10
11/// \brief If T is an array of some type X, provides the member typedef type
12/// equal to X, otherwise type is T. Note that if T is a multidimensional array,
13/// only the first dimension is removed. The behavior of a program that adds
14/// specializations for remove_extent is undefined.
15template <typename T>
17 using type = T;
18};
19
20template <typename T>
21struct remove_extent<T[]> {
22 using type = T;
23};
24
25template <typename T, size_t N>
26struct remove_extent<T[N]> {
27 using type = T;
28};
29
30template <typename T>
31using remove_extent_t = typename remove_extent<T>::type;
32
33} // namespace etl
34
35#endif // TETL_TYPE_TRAITS_REMOVE_EXTENT_HPP
Definition adjacent_find.hpp:9
If T is an array of some type X, provides the member typedef type equal to X, otherwise type is T....
Definition remove_extent.hpp:16