Przeglądaj źródła

stl: std::is_copy_constructible_v

skypjack 1 dzień temu
rodzic
commit
4ac884dfd1

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

@@ -94,7 +94,7 @@ class basic_any: private internal::basic_any_storage<Len, Align> {
                 return (elem == other) ? other : nullptr;
                 return (elem == other) ? other : nullptr;
             }
             }
         case copy:
         case copy:
-            if constexpr(std::is_copy_constructible_v<Type>) {
+            if constexpr(stl::is_copy_constructible_v<Type>) {
                 // NOLINTNEXTLINE(bugprone-casting-through-void)
                 // NOLINTNEXTLINE(bugprone-casting-through-void)
                 static_cast<basic_any *>(const_cast<void *>(other))->initialize<Type>(*elem);
                 static_cast<basic_any *>(const_cast<void *>(other))->initialize<Type>(*elem);
             }
             }
@@ -560,7 +560,7 @@ template<typename Type, std::size_t Len, std::size_t Align>
 template<typename Type, std::size_t Len, std::size_t Align>
 template<typename Type, std::size_t Len, std::size_t Align>
 // NOLINTNEXTLINE(cppcoreguidelines-rvalue-reference-param-not-moved)
 // NOLINTNEXTLINE(cppcoreguidelines-rvalue-reference-param-not-moved)
 [[nodiscard]] stl::remove_const_t<Type> any_cast(basic_any<Len, Align> &&data) noexcept {
 [[nodiscard]] stl::remove_const_t<Type> any_cast(basic_any<Len, Align> &&data) noexcept {
-    if constexpr(std::is_copy_constructible_v<stl::remove_cvref_t<Type>>) {
+    if constexpr(stl::is_copy_constructible_v<stl::remove_cvref_t<Type>>) {
         if(auto *const instance = any_cast<stl::remove_reference_t<Type>>(&data); instance) {
         if(auto *const instance = any_cast<stl::remove_reference_t<Type>>(&data); instance) {
             return static_cast<Type>(stl::move(*instance));
             return static_cast<Type>(stl::move(*instance));
         }
         }

+ 1 - 1
src/entt/entity/storage.hpp

@@ -368,7 +368,7 @@ protected:
      */
      */
     underlying_iterator try_emplace([[maybe_unused]] const Entity entt, [[maybe_unused]] const bool force_back, const void *value) override {
     underlying_iterator try_emplace([[maybe_unused]] const Entity entt, [[maybe_unused]] const bool force_back, const void *value) override {
         if(value != nullptr) {
         if(value != nullptr) {
-            if constexpr(std::is_copy_constructible_v<element_type>) {
+            if constexpr(stl::is_copy_constructible_v<element_type>) {
                 return emplace_element(entt, force_back, *static_cast<const element_type *>(value));
                 return emplace_element(entt, force_back, *static_cast<const element_type *>(value));
             } else {
             } else {
                 return base_type::end();
                 return base_type::end();

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

@@ -12,6 +12,7 @@ using std::invoke_result_t;
 using std::is_aggregate_v;
 using std::is_aggregate_v;
 using std::is_const_v;
 using std::is_const_v;
 using std::is_copy_assignable_v;
 using std::is_copy_assignable_v;
+using std::is_copy_constructible_v;
 using std::is_default_constructible_v;
 using std::is_default_constructible_v;
 using std::is_function_v;
 using std::is_function_v;
 using std::is_invocable_r_v;
 using std::is_invocable_r_v;