From 34af44b8d3750b72ce7b3b8f2f5f362793d7cd83 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Mon, 26 Aug 2019 14:53:21 +0200 Subject: [PATCH] updated doc (close #298) --- docs/md/entity.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/docs/md/entity.md b/docs/md/entity.md index b4790dc89..59651ed82 100644 --- a/docs/md/entity.md +++ b/docs/md/entity.md @@ -1190,9 +1190,7 @@ thrown away. The reasons for this go far beyond the scope of this document.
To iterate a runtime view, either use it in a range-for loop: ```cpp -using component_type = typename decltype(registry)::component_type; -component_type types[] = { registry.type(), registry.type() }; - +entt::component types[] = { registry.type(), registry.type() }; auto view = registry.runtime_view(std::cbegin(types), std::cend(types)); for(auto entity: view) { @@ -1210,10 +1208,9 @@ for(auto entity: view) { Or rely on the `each` member function to iterate entities: ```cpp -using component_type = typename decltype(registry)::component_type; -component_type types[] = { registry.type(), registry.type() }; +entt::component types[] = { registry.type(), registry.type() }; -auto view = registry.runtime_view(std::cbegin(types), std::cend(types)).each([](auto entity) { +registry.runtime_view(std::cbegin(types), std::cend(types)).each([](auto entity) { // ... }); ```