|
|
@@ -610,6 +610,22 @@ public:
|
|
|
return assure<Type>().emplace(entt, std::forward<Args>(args)...);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @brief Assigns each entity in a range the given element.
|
|
|
+ *
|
|
|
+ * @sa emplace
|
|
|
+ *
|
|
|
+ * @tparam Type Type of element to create.
|
|
|
+ * @tparam It Type of input iterator.
|
|
|
+ * @param first An iterator to the first element of the range of entities.
|
|
|
+ * @param last An iterator past the last element of the range of entities.
|
|
|
+ */
|
|
|
+ template<typename Type, typename It>
|
|
|
+ void insert(It first, It last) {
|
|
|
+ ENTT_ASSERT(std::all_of(first, last, [this](const auto entt) { return valid(entt); }), "Invalid entity");
|
|
|
+ assure<Type>().insert(std::move(first), std::move(last));
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @brief Assigns each entity in a range the given element.
|
|
|
*
|
|
|
@@ -622,7 +638,7 @@ public:
|
|
|
* @param value An instance of the element to assign.
|
|
|
*/
|
|
|
template<typename Type, typename It>
|
|
|
- void insert(It first, It last, const Type &value = {}) {
|
|
|
+ void insert(It first, It last, const Type &value) {
|
|
|
ENTT_ASSERT(std::all_of(first, last, [this](const auto entt) { return valid(entt); }), "Invalid entity");
|
|
|
assure<Type>().insert(std::move(first), std::move(last), value);
|
|
|
}
|