1919
2020namespace llvm {
2121
22-
2322// / Metafunction that determines whether the given type is either an
2423// / integral type or an enumeration type, including enum classes.
2524// /
@@ -40,8 +39,10 @@ template <typename T> class is_integral_or_enum {
4039};
4140
4241// / If T is a pointer, just return it. If it is not, return T&.
43- template <typename T, typename Enable = void >
44- struct add_lvalue_reference_if_not_pointer { using type = T &; };
42+ template <typename T, typename Enable = void >
43+ struct add_lvalue_reference_if_not_pointer {
44+ using type = T &;
45+ };
4546
4647template <typename T>
4748struct add_lvalue_reference_if_not_pointer <
@@ -51,8 +52,9 @@ struct add_lvalue_reference_if_not_pointer<
5152
5253// / If T is a pointer to X, return a pointer to const X. If it is not,
5354// / return const T.
54- template <typename T, typename Enable = void >
55- struct add_const_past_pointer { using type = const T; };
55+ template <typename T, typename Enable = void > struct add_const_past_pointer {
56+ using type = const T;
57+ };
5658
5759template <typename T>
5860struct add_const_past_pointer <T, std::enable_if_t <std::is_pointer_v<T>>> {
@@ -69,29 +71,29 @@ struct const_pointer_or_const_ref<T, std::enable_if_t<std::is_pointer_v<T>>> {
6971};
7072
7173namespace detail {
72- template <class T >
73- union trivial_helper {
74- T t;
74+ template <class T > union trivial_helper {
75+ T t;
7576};
7677
77- } // end namespace detail
78+ } // namespace detail
7879
79- template <typename T>
80- struct is_copy_assignable {
81- template <class F >
82- static auto get (F*) -> decltype(std::declval<F &>() = std::declval<const F &>(), std::true_type{});
83- static std::false_type get (...);
84- static constexpr bool value = decltype (get((T*)nullptr ))::value;
80+ template <typename T> struct is_copy_assignable {
81+ template <class F >
82+ static auto get (F *)
83+ -> decltype(std::declval<F &>() = std::declval<const F &>(),
84+ std::true_type{});
85+ static std::false_type get (...);
86+ static constexpr bool value = decltype (get((T *)nullptr ))::value;
8587};
8688
87- template <typename T>
88- struct is_move_assignable {
89- template < class F >
90- static auto get (F*) -> decltype(std::declval<F &>() = std::declval<F &&>(), std::true_type{});
91- static std::false_type get (...);
92- static constexpr bool value = decltype (get((T*)nullptr ))::value;
89+ template <typename T> struct is_move_assignable {
90+ template < class F >
91+ static auto get (F *)
92+ -> decltype(std::declval<F &>() = std::declval<F &&>(), std::true_type{});
93+ static std::false_type get (...);
94+ static constexpr bool value = decltype (get((T *)nullptr ))::value;
9395};
9496
95- } // end namespace llvm
97+ } // namespace llvm
9698
9799#endif // LLVM_SUPPORT_TYPE_TRAITS_H
0 commit comments