1 //===-- remove_extent type_traits -------------------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 #ifndef LLVM_LIBC_SRC___SUPPORT_CPP_TYPE_TRAITS_REMOVE_EXTENT_H 9 #define LLVM_LIBC_SRC___SUPPORT_CPP_TYPE_TRAITS_REMOVE_EXTENT_H 10 11 #include "src/__support/CPP/type_traits/type_identity.h" 12 #include "src/__support/macros/config.h" 13 #include "stddef.h" // size_t 14 15 namespace LIBC_NAMESPACE_DECL { 16 namespace cpp { 17 18 // remove_extent 19 template <class T> struct remove_extent : cpp::type_identity<T> {}; 20 template <class T> struct remove_extent<T[]> : cpp::type_identity<T> {}; 21 template <class T, size_t N> 22 struct remove_extent<T[N]> : cpp::type_identity<T> {}; 23 template <class T> using remove_extent_t = typename remove_extent<T>::type; 24 25 } // namespace cpp 26 } // namespace LIBC_NAMESPACE_DECL 27 28 #endif // LLVM_LIBC_SRC___SUPPORT_CPP_TYPE_TRAITS_REMOVE_EXTENT_H 29