Przeglądaj źródła

stl: std::is_lvalue_reference_v

skypjack 1 dzień temu
rodzic
commit
9efe86621d

+ 2 - 2
src/entt/core/any.hpp

@@ -136,10 +136,10 @@ class basic_any: private internal::basic_any_storage<Len, Align> {
             deleter = nullptr;
             deleter = nullptr;
             mode = any_policy::empty;
             mode = any_policy::empty;
             this->instance = nullptr;
             this->instance = nullptr;
-        } else if constexpr(std::is_lvalue_reference_v<Type>) {
+        } else if constexpr(stl::is_lvalue_reference_v<Type>) {
             deleter = nullptr;
             deleter = nullptr;
             mode = std::is_const_v<std::remove_reference_t<Type>> ? any_policy::cref : any_policy::ref;
             mode = std::is_const_v<std::remove_reference_t<Type>> ? any_policy::cref : any_policy::ref;
-            static_assert((std::is_lvalue_reference_v<Args> && ...) && (sizeof...(Args) == 1u), "Invalid arguments");
+            static_assert((stl::is_lvalue_reference_v<Args> && ...) && (sizeof...(Args) == 1u), "Invalid arguments");
             // NOLINTNEXTLINE(bugprone-multi-level-implicit-pointer-conversion)
             // NOLINTNEXTLINE(bugprone-multi-level-implicit-pointer-conversion)
             this->instance = (std::addressof(args), ...);
             this->instance = (std::addressof(args), ...);
         } else if constexpr(in_situ_v<plain_type>) {
         } else if constexpr(in_situ_v<plain_type>) {

+ 2 - 2
src/entt/meta/utility.hpp

@@ -168,9 +168,9 @@ using meta_function_helper_t = meta_function_helper<Type, Candidate>::type;
 template<meta_policy Policy = as_value_t, typename Type>
 template<meta_policy Policy = as_value_t, typename Type>
 [[nodiscard]] meta_any meta_dispatch(const meta_ctx &ctx, [[maybe_unused]] Type &&value) {
 [[nodiscard]] meta_any meta_dispatch(const meta_ctx &ctx, [[maybe_unused]] Type &&value) {
     if constexpr(stl::is_same_v<Policy, as_cref_t>) {
     if constexpr(stl::is_same_v<Policy, as_cref_t>) {
-        static_assert(std::is_lvalue_reference_v<Type>, "Invalid type");
+        static_assert(stl::is_lvalue_reference_v<Type>, "Invalid type");
         return meta_any{ctx, std::in_place_type<const std::remove_reference_t<Type> &>, stl::as_const(value)};
         return meta_any{ctx, std::in_place_type<const std::remove_reference_t<Type> &>, stl::as_const(value)};
-    } else if constexpr(stl::is_same_v<Policy, as_ref_t> || (stl::is_same_v<Policy, as_is_t> && std::is_lvalue_reference_v<Type>)) {
+    } else if constexpr(stl::is_same_v<Policy, as_ref_t> || (stl::is_same_v<Policy, as_is_t> && stl::is_lvalue_reference_v<Type>)) {
         return meta_any{ctx, std::in_place_type<Type>, value};
         return meta_any{ctx, std::in_place_type<Type>, value};
     } else if constexpr(stl::is_same_v<Policy, as_void_t>) {
     } else if constexpr(stl::is_same_v<Policy, as_void_t>) {
         return meta_any{ctx, std::in_place_type<void>};
         return meta_any{ctx, std::in_place_type<void>};

+ 1 - 0
src/entt/stl/type_traits.hpp

@@ -9,6 +9,7 @@ namespace entt::stl {
 using std::false_type;
 using std::false_type;
 using std::invoke_result_t;
 using std::invoke_result_t;
 using std::is_invocable_r_v;
 using std::is_invocable_r_v;
+using std::is_lvalue_reference_v;
 using std::is_member_object_pointer_v;
 using std::is_member_object_pointer_v;
 using std::is_pointer_v;
 using std::is_pointer_v;
 using std::is_same_v;
 using std::is_same_v;