Update optional_fields.md, fixed typo

This commit is contained in:
liuzicheng1987
2023-10-08 16:27:33 +02:00
committed by GitHub
parent 6c2d947063
commit 575d36307e
+1 -2
View File
@@ -13,8 +13,7 @@ But Bart doesn't have any children. After all, he's only 10 years old. To indica
we can use either `std::optional`, `std::shared_ptr` or `std::unique_ptr`.
If `std::optional` is `std::nullopt` or any of the smart pointers is a `nullptr`,
then the field will not be written to the JSON string. Likewise, it is not required
when you read the JSON string, the fields will not be required.
then the field will not be written to the JSON string. Likewise, when you read the JSON string, the fields will not be required.
So this is how we could rewrite the previous example: