Skip to content

Commit d710333

Browse files
authored
Readme update.
1 parent e92d2eb commit d710333

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,15 @@ Yes — `rtl::function`’s dispatch is faster than `std::function`.
5757
Create an instance of `CxxMirror`, passing all type information directly to its constructor — and you’re done!
5858
```c++
5959
auto cxx_mirror = rtl::CxxMirror({
60-
// Register free function -
60+
// Register free(C-Style) function -
6161
rtl::type().function("complexToStr").build(complexToStr),
62-
// Register class 'Person'-
63-
rtl::type().record<Person>("Person").build(),
64-
rtl::type().member<Person>().constructor<std::string, int>().build(), // User defined ctor.
65-
rtl::type().member<Person>().method("setAge").build(Person::setAge), // a setter method.
66-
rtl::type().member<Person>().method("getName").build(Person::getName) // and a getter.
62+
// Register class 'Person' ('record' is general term used for 'struct/class') -
63+
rtl::type().record<Person>("Person").build(), // Registers default/copy ctor as well.
64+
// Register user-defined ctor -
65+
rtl::type().member<Person>().constructor<std::string, int>().build(),
66+
// Register methods -
67+
rtl::type().member<Person>().method("setAge").build(&Person::setAge),
68+
rtl::type().member<Person>().method("getName").build(&Person::getName)
6769
});
6870
```
6971
The `cxx_mirror` object is your gateway to runtime reflection — it lets you query, introspect, and even instantiate types without any compile-time knowledge. It can live anywhere — in any translation unit, quietly resting in a corner of your codebase, remaining dormant until first access. All you need is to expose the `cxx_mirror` wherever reflection is required.

0 commit comments

Comments
 (0)