diff --git a/TODO b/TODO index 542b0c070..9f394c4b1 100644 --- a/TODO +++ b/TODO @@ -18,6 +18,7 @@ Next: * replace observer class with observer functions +* patch rather than replace, emplace rather then assign (when we have args... ofc) * WIP: - deprecate snapshot, loader, ... diff --git a/src/entt/entity/registry.hpp b/src/entt/entity/registry.hpp index 1fa146c88..12a5b1191 100644 --- a/src/entt/entity/registry.hpp +++ b/src/entt/entity/registry.hpp @@ -704,6 +704,13 @@ public: * Temporary objects are returned for empty types though. Capture them by * copy or by const reference if needed. * + * @warning + * Attempting to use an invalid entity or to replace a component of an + * entity that doesn't own it results in undefined behavior.
+ * An assertion will abort the execution at runtime in debug mode in case of + * invalid entity or if the entity doesn't own an instance of the given + * component. + * * @tparam Component Type of component to replace. * @tparam Func Types of the function objects to invoke. * @param entity A valid entity identifier.