File tree 3 files changed +34
-0
lines changed
utils/bazel/llvm-project-overlay/libc 3 files changed +34
-0
lines changed Original file line number Diff line number Diff line change 36
36
#include " src/__support/CPP/type_traits/is_reference.h"
37
37
#include " src/__support/CPP/type_traits/is_rvalue_reference.h"
38
38
#include " src/__support/CPP/type_traits/is_same.h"
39
+ #include " src/__support/CPP/type_traits/is_scalar.h"
39
40
#include " src/__support/CPP/type_traits/is_signed.h"
40
41
#include " src/__support/CPP/type_traits/is_trivially_constructible.h"
41
42
#include " src/__support/CPP/type_traits/is_trivially_copyable.h"
Original file line number Diff line number Diff line change
1
+ // ===-- is_scalar 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_IS_SCALAR_H
9
+ #define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_SCALAR_H
10
+
11
+ #include " src/__support/CPP/type_traits/bool_constant.h"
12
+ #include " src/__support/CPP/type_traits/is_arithmetic.h"
13
+ #include " src/__support/CPP/type_traits/is_enum.h"
14
+ #include " src/__support/CPP/type_traits/is_member_pointer.h"
15
+ #include " src/__support/CPP/type_traits/is_null_pointer.h"
16
+ #include " src/__support/CPP/type_traits/is_pointer.h"
17
+ #include " src/__support/macros/attributes.h"
18
+
19
+ namespace __llvm_libc ::cpp {
20
+
21
+ // is_scalar
22
+ template <class T >
23
+ struct is_scalar
24
+ : cpp::bool_constant<cpp::is_arithmetic_v<T> || cpp::is_enum_v<T> ||
25
+ cpp::is_pointer_v<T> || cpp::is_member_pointer_v<T> ||
26
+ cpp::is_null_pointer_v<T>> {};
27
+ template <class T >
28
+ LIBC_INLINE_VAR constexpr bool is_scalar_v = is_scalar<T>::value;
29
+
30
+ } // namespace __llvm_libc::cpp
31
+
32
+ #endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_SCALAR_H
Original file line number Diff line number Diff line change @@ -313,6 +313,7 @@ libc_support_library(
313
313
"src/__support/CPP/type_traits/is_reference.h" ,
314
314
"src/__support/CPP/type_traits/is_rvalue_reference.h" ,
315
315
"src/__support/CPP/type_traits/is_same.h" ,
316
+ "src/__support/CPP/type_traits/is_scalar.h" ,
316
317
"src/__support/CPP/type_traits/is_signed.h" ,
317
318
"src/__support/CPP/type_traits/is_trivially_constructible.h" ,
318
319
"src/__support/CPP/type_traits/is_trivially_copyable.h" ,
You can’t perform that action at this time.
0 commit comments