You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-6
Original file line number
Diff line number
Diff line change
@@ -1633,9 +1633,7 @@ struct my_int_reader_writer
1633
1633
1634
1634
void write(const int & v, ...) const {...} // Custom write procedure for int.
1635
1635
};
1636
-
1637
1636
...
1638
-
1639
1637
structmy_data
1640
1638
{
1641
1639
int field_;
@@ -1652,9 +1650,9 @@ struct my_data
1652
1650
1653
1651
In that case a reference to an `int` will be passed to `my_int_reader_writer`'s `read` and `write` methods.
1654
1652
1655
-
But if`my_data` isn't `int` but a `std::vector<int>` then a reference to `std::vector<int>` instance will be passed to `read`/`write`. And there will be a compiler error because `read`/`write` expects a reference to an `int`.
1653
+
In the case when`my_data` isn't `int` but a `std::vector<int>` then a reference to `std::vector<int>` instance will be passed to `read`/`write`. And there will be a compiler error because `read`/`write` expects a reference to an `int`.
1656
1654
1657
-
If we want to apply our custom Reader_Writer be applied for every member of a container then `json_dto::apply_to_content_t` proxy should be used as Reader_Writer type:
1655
+
If we want our custom Reader_Writer to be applied for every member of a container then `json_dto::apply_to_content_t` proxy should be used as Reader_Writer type:
1658
1656
1659
1657
```cpp
1660
1658
structmy_complex_data
@@ -1736,13 +1734,13 @@ struct my_complex_data {
1736
1734
1737
1735
### Overloading of read_json_value/write_json_value for const_map_key_t/mutable_map_key_t
1738
1736
1739
-
Since v.0.2.11 json_dto (de)serializes keys of map-like containers (like `std::map`, `std::multimap`, `std::unordered_map` and so on) by using new proxy types `const_map_key_t` and `mutable_map_key_t`.
1737
+
Since v.0.2.11 json_dto (de)serializes keys of map-like containers (`std::map`, `std::multimap`, `std::unordered_map` and so on) by using new proxy types `const_map_key_t` and `mutable_map_key_t`.
1740
1738
1741
1739
A new type `const_map_key_t<T>` is used for serializing a key of type T.
1742
1740
1743
1741
A new type `mutable_map_key_t<T>` is used for deserializing a key of type T.
1744
1742
1745
-
It means that if someone wants to make overloads of `read_json_value` and `write_json_value` for types that used as keys in map-like structures, then such overloads should be placed into `json_dto` namespace and should have the following prototypes:
1743
+
It means that if someone wants to make overloads of `read_json_value` and `write_json_value` for types that are used as keys in map-like structures, then such overloads should be placed into `json_dto` namespace and should have the following prototypes:
0 commit comments