diff --git a/src/entt/entity/registry.hpp b/src/entt/entity/registry.hpp index c5373461f..8241a4817 100644 --- a/src/entt/entity/registry.hpp +++ b/src/entt/entity/registry.hpp @@ -59,7 +59,8 @@ public: constexpr registry_storage_iterator(It iter) noexcept : it{iter} {} - template && std::is_constructible_v>> + template + requires (!std::same_as && std::constructible_from) constexpr registry_storage_iterator(const registry_storage_iterator &other) noexcept : registry_storage_iterator{other.it} {} @@ -613,7 +614,8 @@ public: * @param last An iterator past the last element of the range of entities. * @param from An iterator to the first element of the range of elements. */ - template::value_type, Type>>> + template + requires std::same_as::value_type, Type> void insert(EIt first, EIt last, CIt from) { ENTT_ASSERT(std::all_of(first, last, [this](const auto entt) { return valid(entt); }), "Invalid entity"); assure().insert(first, last, from); diff --git a/src/entt/entity/storage.hpp b/src/entt/entity/storage.hpp index 0b8189b46..46b21999e 100644 --- a/src/entt/entity/storage.hpp +++ b/src/entt/entity/storage.hpp @@ -53,8 +53,9 @@ public: : payload{ref}, offset{idx} {} - template, typename = std::enable_if_t> - constexpr storage_iterator(const storage_iterator, Page> &other) noexcept + template> Other> + requires std::is_const_v + constexpr storage_iterator(const storage_iterator &other) noexcept : storage_iterator{other.payload, other.offset} {} constexpr storage_iterator &operator++() noexcept { @@ -152,7 +153,8 @@ public: constexpr extended_storage_iterator(iterator_type base, Other... other) : it{base, other...} {} - template && ...) && (std::is_constructible_v && ...)>> + template + requires (!std::same_as && ...) && (std::constructible_from && ...) constexpr extended_storage_iterator(const extended_storage_iterator &other) : it{other.it} {} @@ -715,7 +717,8 @@ public: * @param from An iterator to the first element of the range of objects. * @return Iterator pointing to the first element inserted, if any. */ - template::value_type, value_type>>> + template + requires std::same_as::value_type, value_type> iterator insert(EIt first, EIt last, CIt from) { for(; first != last; ++first, ++from) { emplace_element(*first, true, *from);