Skip to content

Commit 88cf229

Browse files
Fixed typos in the documentation
1 parent beb27d4 commit 88cf229

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

docs/processors.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ The resulting JSON string looks like this:
6262
{"type":"Person","first_name":"Homer","last_name":"Simpson","age":45}
6363
```
6464

65-
### `rfl::AddStructsToVariants`
65+
### `rfl::AddTagsToVariants`
6666

67-
This processor automatically adds structs to variants. Consider the following example:
67+
This processor automatically adds tags to variants. Consider the following example:
6868

6969
```cpp
7070
struct button_pressed_t {};
@@ -79,8 +79,8 @@ using my_event_type_t =
7979
std::variant<button_pressed_t, button_released_t, key_pressed_t, int>;
8080
```
8181
82-
The problem here is that `button_pressed_t` and `butten_released_t` virtually look
83-
indistinguishable. The will both be serialized to `{}`.
82+
The problem here is that `button_pressed_t` and `button_released_t` virtually look
83+
indistinguishable when they are serialized. The will both be serialized to `{}`.
8484
8585
But you can add this processor to automatically add tags and avoid the problem:
8686
@@ -114,6 +114,9 @@ struct key_pressed_t {
114114
{"your_custom_tag":{"key":99}}
115115
```
116116

117+
Note that there are other ways to address problems like this, for instance `rfl::TaggedUnion`.
118+
Please refer to the relevant sections of the documentation.
119+
117120
### `rfl::AllowRawPtrs`
118121

119122
By default, reflect-cpp does not allow *reading into* raw pointers. (*Writing from* raw pointers is never a problem.) This is because reading into raw pointers means that the library will allocate memory that the user then has to manually delete. This can lead to misunderstandings and memory leaks.

0 commit comments

Comments
 (0)