[go: up one dir, main page]

Skip to content

Commit

Permalink
storage: consume args for empty types in all cases
Browse files Browse the repository at this point in the history
  • Loading branch information
skypjack committed Mar 13, 2020
1 parent 5e04f0a commit 97e0d63
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* document undocumented parts (entt::overload and a few others)
* any-of rule for views/groups (eg entity has A and any of B/C/D)
- get -> all, exclude -> none
* review multi component views to reduce instantiations once empty types are gone...

Next:
* replace observer class with observer functions
Expand Down
9 changes: 4 additions & 5 deletions src/entt/entity/storage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -694,16 +694,15 @@ class storage<Entity, Type, std::enable_if_t<ENTT_ENABLE_ETO(Type)>>: public spa
*
* @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 emplace(const entity_type entt, Args &&...) {
void emplace(const entity_type entt, Args &&... args) {
[[maybe_unused]] object_type instance{std::forward<Args>(args)...};
underlying_type::construct(entt);
}

/**
* @copydoc emplace
* @param args Parameters to use to construct an object for the entity.
*/
/*! @copydoc emplace */
template<typename... Args>
[[deprecated("use ::emplace instead")]]
void construct(const entity_type entt, Args &&... args) {
Expand Down

0 comments on commit 97e0d63

Please sign in to comment.