|
|
@@ -332,10 +332,9 @@ public:
|
|
|
|
|
|
/**
|
|
|
* @brief Assigns one or more entities to a storage and default constructs
|
|
|
- * or copy constructs their objects.
|
|
|
+ * their objects.
|
|
|
*
|
|
|
- * The object type must be at least move and default insertable if no
|
|
|
- * arguments are provided, move and copy insertable otherwise.
|
|
|
+ * The object type must be at least move and default insertable.
|
|
|
*
|
|
|
* @warning
|
|
|
* Attempting to assign an entity that already belongs to the storage
|
|
|
@@ -344,17 +343,15 @@ public:
|
|
|
* storage already contains the given entity.
|
|
|
*
|
|
|
* @tparam It Type of forward iterator.
|
|
|
- * @tparam Args Types of arguments to use to construct the object.
|
|
|
* @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.
|
|
|
- * @param args Parameters to use to construct an object for the entities.
|
|
|
* @return An iterator to the list of instances just created and sorted the
|
|
|
* same of the entities.
|
|
|
*/
|
|
|
- template<typename It, typename... Args>
|
|
|
+ template<typename It>
|
|
|
std::enable_if_t<std::is_same_v<typename std::iterator_traits<It>::value_type, entity_type>, reverse_iterator_type>
|
|
|
- construct(It first, It last, Args &&... args) {
|
|
|
- instances.insert(instances.end(), std::distance(first, last), object_type{std::forward<Args>(args)...});
|
|
|
+ construct(It first, It last) {
|
|
|
+ instances.insert(instances.end(), std::distance(first, last), object_type{});
|
|
|
// entity goes after component in case constructor throws
|
|
|
underlying_type::construct(first, last);
|
|
|
return std::make_reverse_iterator(begin() + std::distance(first, last));
|
|
|
@@ -656,8 +653,6 @@ public:
|
|
|
/**
|
|
|
* @brief Assigns an entity to a storage and constructs its object.
|
|
|
*
|
|
|
- * The object type must be at least copy constructible.
|
|
|
- *
|
|
|
* @warning
|
|
|
* Attempting to use an entity that already belongs to the storage results
|
|
|
* in undefined behavior.<br/>
|
|
|
@@ -666,21 +661,15 @@ public:
|
|
|
*
|
|
|
* @tparam Args Types of arguments to use to construct the object.
|
|
|
* @param entt A valid entity identifier.
|
|
|
- * @param args Parameters to use to construct an object for the entity.
|
|
|
*/
|
|
|
template<typename... Args>
|
|
|
- void construct(const entity_type entt, Args &&... args) {
|
|
|
- [[maybe_unused]] object_type instance{std::forward<Args>(args)...};
|
|
|
- // entity goes after component in case constructor throws
|
|
|
+ void construct(const entity_type entt, Args &&...) {
|
|
|
underlying_type::construct(entt);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @brief Assigns one or more entities to a storage.
|
|
|
*
|
|
|
- * The object type must be at least default constructible if no arguments
|
|
|
- * are provided.
|
|
|
- *
|
|
|
* @warning
|
|
|
* Attempting to assign an entity that already belongs to the storage
|
|
|
* results in undefined behavior.<br/>
|
|
|
@@ -688,18 +677,14 @@ public:
|
|
|
* storage already contains the given entity.
|
|
|
*
|
|
|
* @tparam It Type of forward iterator.
|
|
|
- * @tparam Args Types of arguments to use to construct the object.
|
|
|
* @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.
|
|
|
- * @param args Parameters to use to construct an object for the entities.
|
|
|
* @return An iterator to the list of instances just created and sorted the
|
|
|
* same of the entities.
|
|
|
*/
|
|
|
- template<typename It, typename... Args>
|
|
|
+ template<typename It>
|
|
|
std::enable_if_t<std::is_same_v<typename std::iterator_traits<It>::value_type, entity_type>, reverse_iterator_type>
|
|
|
- construct(It first, It last, Args &&... args) {
|
|
|
- [[maybe_unused]] object_type instance{std::forward<Args>(args)...};
|
|
|
- // entity goes after component in case constructor throws
|
|
|
+ construct(It first, It last) {
|
|
|
underlying_type::construct(first, last);
|
|
|
return std::make_reverse_iterator(begin() + std::distance(first, last));
|
|
|
}
|