doc: added more details

This commit is contained in:
Michele Caini
2020-12-12 16:39:45 +01:00
parent a344a1ca59
commit 3d5905c878
2 changed files with 13 additions and 5 deletions

View File

@@ -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>};
```

View File

@@ -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/>