From 23bdbeef4e07280b15c0d7962ab489d12e173bdd Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Wed, 6 Apr 2022 09:50:42 +0200 Subject: [PATCH] doc: updated type_info section --- docs/md/core.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/md/core.md b/docs/md/core.md index 5e79e0723..bfd07dd9f 100644 --- a/docs/md/core.md +++ b/docs/md/core.md @@ -559,14 +559,23 @@ require to enable RTTI.
Therefore, they can sometimes be even more reliable than those obtained otherwise. -A type info object is an opaque class that is also copy and move constructible. -Objects of this class are returned by the `type_id` function template: +Its type defines a default constructible opaque class that is also copyable and +movable.
+Objects of this class are generally returned by the `type_id` functions: ```cpp +// by type auto info = entt::type_id(); + +// by value +auto other = entt::type_id(42); ``` -These are the information made available by a `type_info` object: +The objects thus received are nothing more than const references to instances of +`type_info` with static storage duration.
+This is convenient for saving the entire object aside for the cost of a pointer. +However, nothing prevents from constructing `type_info` objects directly.
+These are the information made available by this kind of objects: * The index associated with a given type: