Kaynağa Gözat

doc: added more details

Michele Caini 5 yıl önce
ebeveyn
işleme
3d5905c878
2 değiştirilmiş dosya ile 13 ekleme ve 5 silme
  1. 4 3
      docs/md/meta.md
  2. 9 2
      docs/md/poly.md

+ 4 - 3
docs/md/meta.md

@@ -215,11 +215,12 @@ const bool equal = (any == other);
 Also, `meta_any` adds support for containers and pointer-like types (see the
 following sections for more details).<br/>
 Similar to `any`, this class can also be used to create _aliases_ for unmanaged
-objects. However, unlike `any`,` meta_any` treats an empty instance and one
-initialized with `void` differently:
+objects either upon construction using `std::ref` or from an existing instance
+by means of the `as_ref` function. However, unlike `any`,` meta_any` treats an
+empty instance and one initialized with `void` differently:
 
 ```cpp
-entt::meta_any any{};
+entt::meta_any empty{};
 entt::meta_any other{std::in_place_type<void>};
 ```
 

+ 9 - 2
docs/md/poly.md

@@ -320,8 +320,15 @@ circle c;
 drawable d{std::ref(c)};
 ```
 
-In this case, although the interface of the `poly` object doesn't change, it
-won't construct any element or take care of destroying the referenced object.
+Similarly, it's possible to create non-owning copies of `poly` from an existing
+object:
+
+```cpp
+drawable other = as_ref(d);
+```
+
+In both cases, although the interface of the `poly` object doesn't change, it
+won't construct any element or take care of destroying the referenced objects.
 
 Note also how the underlying concept is accessed via a call to `operator->` and
 not directly as `d.draw()`.<br/>