ソースを参照

stl: std::constructible_from

skypjack 1 ヶ月 前
コミット
b5cd97f915

+ 3 - 3
src/entt/container/dense_map.hpp

@@ -79,7 +79,7 @@ public:
         : it{iter} {}
         : it{iter} {}
 
 
     template<typename Other>
     template<typename Other>
-    requires (!stl::same_as<It, Other> && std::constructible_from<It, Other>)
+    requires (!stl::same_as<It, Other> && stl::constructible_from<It, Other>)
     constexpr dense_map_iterator(const dense_map_iterator<Other> &other) noexcept
     constexpr dense_map_iterator(const dense_map_iterator<Other> &other) noexcept
         : it{other.it} {}
         : it{other.it} {}
 
 
@@ -174,7 +174,7 @@ public:
           offset{pos} {}
           offset{pos} {}
 
 
     template<typename Other>
     template<typename Other>
-    requires (!stl::same_as<It, Other> && std::constructible_from<It, Other>)
+    requires (!stl::same_as<It, Other> && stl::constructible_from<It, Other>)
     constexpr dense_map_local_iterator(const dense_map_local_iterator<Other> &other) noexcept
     constexpr dense_map_local_iterator(const dense_map_local_iterator<Other> &other) noexcept
         : it{other.it},
         : it{other.it},
           offset{other.offset} {}
           offset{other.offset} {}
@@ -534,7 +534,7 @@ public:
      * @tparam Arg Type of the key-value pair to insert into the container.
      * @tparam Arg Type of the key-value pair to insert into the container.
      */
      */
     template<typename Arg>
     template<typename Arg>
-    requires std::constructible_from<value_type, Arg &&>
+    requires stl::constructible_from<value_type, Arg &&>
     stl::pair<iterator, bool> insert(Arg &&value) {
     stl::pair<iterator, bool> insert(Arg &&value) {
         return insert_or_do_nothing(stl::forward<Arg>(value).first, stl::forward<Arg>(value).second);
         return insert_or_do_nothing(stl::forward<Arg>(value).first, stl::forward<Arg>(value).second);
     }
     }

+ 2 - 2
src/entt/container/dense_set.hpp

@@ -48,7 +48,7 @@ public:
         : it{iter} {}
         : it{iter} {}
 
 
     template<typename Other>
     template<typename Other>
-    requires (!stl::same_as<It, Other> && std::constructible_from<It, Other>)
+    requires (!stl::same_as<It, Other> && stl::constructible_from<It, Other>)
     constexpr dense_set_iterator(const dense_set_iterator<Other> &other) noexcept
     constexpr dense_set_iterator(const dense_set_iterator<Other> &other) noexcept
         : it{other.it} {}
         : it{other.it} {}
 
 
@@ -140,7 +140,7 @@ public:
           offset{pos} {}
           offset{pos} {}
 
 
     template<typename Other>
     template<typename Other>
-    requires (!stl::same_as<It, Other> && std::constructible_from<It, Other>)
+    requires (!stl::same_as<It, Other> && stl::constructible_from<It, Other>)
     constexpr dense_set_local_iterator(const dense_set_local_iterator<Other> &other) noexcept
     constexpr dense_set_local_iterator(const dense_set_local_iterator<Other> &other) noexcept
         : it{other.it},
         : it{other.it},
           offset{other.offset} {}
           offset{other.offset} {}

+ 1 - 1
src/entt/container/table.hpp

@@ -35,7 +35,7 @@ public:
         : it{from...} {}
         : it{from...} {}
 
 
     template<typename... Other>
     template<typename... Other>
-    requires (std::constructible_from<It, Other> && ...)
+    requires (stl::constructible_from<It, Other> && ...)
     constexpr table_iterator(const table_iterator<Other...> &other) noexcept
     constexpr table_iterator(const table_iterator<Other...> &other) noexcept
         : table_iterator{stl::get<Other>(other.it)...} {}
         : table_iterator{stl::get<Other>(other.it)...} {}
 
 

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

@@ -57,7 +57,7 @@ public:
         : it{iter} {}
         : it{iter} {}
 
 
     template<typename Other>
     template<typename Other>
-    requires (!stl::same_as<It, Other> && std::constructible_from<It, Other>)
+    requires (!stl::same_as<It, Other> && stl::constructible_from<It, Other>)
     constexpr registry_storage_iterator(const registry_storage_iterator<Other> &other) noexcept
     constexpr registry_storage_iterator(const registry_storage_iterator<Other> &other) noexcept
         : registry_storage_iterator{other.it} {}
         : registry_storage_iterator{other.it} {}
 
 

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

@@ -152,7 +152,7 @@ public:
         : it{base, other...} {}
         : it{base, other...} {}
 
 
     template<typename... Args>
     template<typename... Args>
-    requires (!stl::same_as<Other, Args> && ...) && (std::constructible_from<Other, Args> && ...)
+    requires (!stl::same_as<Other, Args> && ...) && (stl::constructible_from<Other, Args> && ...)
     constexpr extended_storage_iterator(const extended_storage_iterator<It, Args...> &other)
     constexpr extended_storage_iterator(const extended_storage_iterator<It, Args...> &other)
         : it{other.it} {}
         : it{other.it} {}
 
 

+ 3 - 3
src/entt/locator/locator.hpp

@@ -86,7 +86,7 @@ public:
      * @return A reference to a valid service.
      * @return A reference to a valid service.
      */
      */
     template<std::derived_from<Service> Type = Service, typename... Args>
     template<std::derived_from<Service> Type = Service, typename... Args>
-    requires std::constructible_from<Type, Args...>
+    requires stl::constructible_from<Type, Args...>
     [[nodiscard]] static Service &value_or(Args &&...args) {
     [[nodiscard]] static Service &value_or(Args &&...args) {
         return service ? *service : emplace<Type>(stl::forward<Args>(args)...);
         return service ? *service : emplace<Type>(stl::forward<Args>(args)...);
     }
     }
@@ -99,7 +99,7 @@ public:
      * @return A reference to a valid service.
      * @return A reference to a valid service.
      */
      */
     template<std::derived_from<Service> Type = Service, typename... Args>
     template<std::derived_from<Service> Type = Service, typename... Args>
-    requires std::constructible_from<Type, Args...>
+    requires stl::constructible_from<Type, Args...>
     static Service &emplace(Args &&...args) {
     static Service &emplace(Args &&...args) {
         service = std::make_shared<Type>(stl::forward<Args>(args)...);
         service = std::make_shared<Type>(stl::forward<Args>(args)...);
         return *service;
         return *service;
@@ -114,7 +114,7 @@ public:
      * @return A reference to a valid service.
      * @return A reference to a valid service.
      */
      */
     template<std::derived_from<Service> Type = Service, typename... Args>
     template<std::derived_from<Service> Type = Service, typename... Args>
-    requires std::constructible_from<Type, Args...>
+    requires stl::constructible_from<Type, Args...>
     static Service &emplace(stl::allocator_arg_t, auto alloc, Args &&...args) {
     static Service &emplace(stl::allocator_arg_t, auto alloc, Args &&...args) {
         service = std::allocate_shared<Type>(alloc, stl::forward<Args>(args)...);
         service = std::allocate_shared<Type>(alloc, stl::forward<Args>(args)...);
         return *service;
         return *service;

+ 1 - 1
src/entt/resource/cache.hpp

@@ -42,7 +42,7 @@ public:
         : it{iter} {}
         : it{iter} {}
 
 
     template<typename Other>
     template<typename Other>
-    requires (!stl::same_as<It, Other> && std::constructible_from<It, Other>)
+    requires (!stl::same_as<It, Other> && stl::constructible_from<It, Other>)
     constexpr resource_cache_iterator(const resource_cache_iterator<stl::remove_const_t<Type>, Other> &other) noexcept
     constexpr resource_cache_iterator(const resource_cache_iterator<stl::remove_const_t<Type>, Other> &other) noexcept
         : it{other.it} {}
         : it{other.it} {}
 
 

+ 4 - 4
src/entt/resource/resource.hpp

@@ -63,7 +63,7 @@ public:
      * @param other The handle to copy from.
      * @param other The handle to copy from.
      */
      */
     template<typename Other>
     template<typename Other>
-    requires (!stl::same_as<Type, Other> && std::constructible_from<Type &, Other &>)
+    requires (!stl::same_as<Type, Other> && stl::constructible_from<Type &, Other &>)
     resource(const resource<Other> &other) noexcept
     resource(const resource<Other> &other) noexcept
         : value{other.value} {}
         : value{other.value} {}
 
 
@@ -73,7 +73,7 @@ public:
      * @param other The handle to move from.
      * @param other The handle to move from.
      */
      */
     template<typename Other>
     template<typename Other>
-    requires (!stl::same_as<Type, Other> && std::constructible_from<Type &, Other &>)
+    requires (!stl::same_as<Type, Other> && stl::constructible_from<Type &, Other &>)
     resource(resource<Other> &&other) noexcept
     resource(resource<Other> &&other) noexcept
         : value{stl::move(other.value)} {}
         : value{stl::move(other.value)} {}
 
 
@@ -99,7 +99,7 @@ public:
      * @return This resource handle.
      * @return This resource handle.
      */
      */
     template<typename Other>
     template<typename Other>
-    requires (!stl::same_as<Type, Other> && std::constructible_from<Type &, Other &>)
+    requires (!stl::same_as<Type, Other> && stl::constructible_from<Type &, Other &>)
     resource &operator=(const resource<Other> &other) noexcept {
     resource &operator=(const resource<Other> &other) noexcept {
         value = other.value;
         value = other.value;
         return *this;
         return *this;
@@ -112,7 +112,7 @@ public:
      * @return This resource handle.
      * @return This resource handle.
      */
      */
     template<typename Other>
     template<typename Other>
-    requires (!stl::same_as<Type, Other> && std::constructible_from<Type &, Other &>)
+    requires (!stl::same_as<Type, Other> && stl::constructible_from<Type &, Other &>)
     resource &operator=(resource<Other> &&other) noexcept {
     resource &operator=(resource<Other> &&other) noexcept {
         value = stl::move(other.value);
         value = stl::move(other.value);
         return *this;
         return *this;

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

@@ -6,6 +6,7 @@
 /*! @cond ENTT_INTERNAL */
 /*! @cond ENTT_INTERNAL */
 namespace entt::stl {
 namespace entt::stl {
 
 
+using std::constructible_from;
 using std::same_as;
 using std::same_as;
 
 
 } // namespace entt::stl
 } // namespace entt::stl