浏览代码

doc: update to reflect last changes (close #1061)

Michele Caini 2 年之前
父节点
当前提交
104fb0f06c
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      docs/md/entity.md

+ 4 - 1
docs/md/entity.md

@@ -1817,7 +1817,10 @@ However, it's possible to _enforce_ iteration of a view by given component order
 by means of the `use` function:
 by means of the `use` function:
 
 
 ```cpp
 ```cpp
-for(auto entity : registry.view<position, velocity>().use<position>()) {
+auto view = registry.view<position, velocity>();
+view.use<position>();
+
+for(auto entity: view) {
     // ...
     // ...
 }
 }
 ```
 ```