| // Part of the Crubit project, under the Apache License v2.0 with LLVM | |
| // Exceptions. See /LICENSE for license information. | |
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| // Mock of standard library <type_traits> header. | |
| #ifndef CRUBIT_NULLABILITY_TEST_TYPE_TRAITS_ | |
| #define CRUBIT_NULLABILITY_TEST_TYPE_TRAITS_ | |
| namespace std { | |
| template<class T> struct remove_pointer { using type = T; }; | |
| template<class T> struct remove_pointer<T*> { using type = T; }; | |
| template<class T> struct remove_pointer<T* const> { using type = T; }; | |
| template<class T> struct remove_pointer<T* volatile> { using type = T; }; | |
| template<class T> struct remove_pointer<T* const volatile> { using type = T; }; | |
| template<class T> using remove_pointer_t = typename remove_pointer<T>::type; | |
| template <bool, class T = void> | |
| struct enable_if {}; | |
| template <class T> | |
| struct enable_if<true, T> { | |
| using type = T; | |
| }; | |
| template <class> | |
| inline const bool __is_unbounded_array_v = false; | |
| template <class T> | |
| inline const bool __is_unbounded_array_v<T[]> = true; | |
| } // namespace std | |
| #endif // CRUBIT_NULLABILITY_TEST_TYPE_TRAITS_ |