From 85152bac3462c95e7be02cd4077bef8fc56de804 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Wed, 15 May 2019 23:41:51 +0200 Subject: [PATCH] doc --- TODO | 2 -- docs/md/entity.md | 13 +++++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/TODO b/TODO index 5d8d28ce8f..c4811805f0 100644 --- a/TODO +++ b/TODO @@ -26,5 +26,3 @@ * multi component registry::remove and some others? * move CONTRIBUTING.md within doc (for GitHub) * reactive systems - -* test snapshot for empty types diff --git a/docs/md/entity.md b/docs/md/entity.md index 85f253ee66..9f35fc27b7 100644 --- a/docs/md/entity.md +++ b/docs/md/entity.md @@ -1464,15 +1464,20 @@ performance and memory usage. However, this also has consequences that are worth mentioning. When an empty type is detected, it's not instantiated in any case. Therefore, -only the entities to which it's assigned are made availble. All the iterators as -well as the `get` member functions of registries, views and groups will return -temporary objects. Similarly, some functions such as `try_get` or the raw access -to the list of components aren't available for this kind of types.
+only the entities to which it's assigned are made available. All the iterators +as well as the `get` member functions of the registry, the views and the groups +will return temporary objects. Similarly, some functions such as `try_get` or +the raw access to the list of components aren't available for this kind of +types.
On the other hand, iterations are faster because only the entities to which the type is assigned are considered. Moreover, less memory is used, since there doesn't exist any instance of the component, no matter how many entities it is assigned to. +For similar reasons, wherever a function type of a listener accepts a component, +it cannot be caught by a non-const reference. Capture it by copy or by const +reference instead. + More in general, none of the features offered by the library is affected, but for the ones that require to return actual instances.