address review comments
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
This commit is contained in:
parent
5f7d41c0a4
commit
6747555bc7
@ -58,6 +58,7 @@ inline void from_json(const BasicJsonType& j, type& e);
|
|||||||
Expected output:
|
Expected output:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
--8<-- "examples/nlohmann_json_serialize_enum_strict.output"
|
||||||
[json.exception.type_error.302] serialization failed: enum value 3 is out of range
|
[json.exception.type_error.302] serialization failed: enum value 3 is out of range
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -72,6 +73,7 @@ inline void from_json(const BasicJsonType& j, type& e);
|
|||||||
Expected output:
|
Expected output:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
--8<-- "examples/nlohmann_json_deserialize_enum_strict.output"
|
||||||
[json.exception.type_error.302] deserialization failed: invalid JSON value "yellow"
|
[json.exception.type_error.302] deserialization failed: invalid JSON value "yellow"
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -20,9 +20,8 @@ NLOHMANN_JSON_SERIALIZE_ENUM_STRICT(Color,
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
|
||||||
// deserialization
|
|
||||||
json j_yellow = "yellow";
|
json j_yellow = "yellow";
|
||||||
|
// deserialization
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
auto yellow = j_yellow.template get<ns::Color>();
|
auto yellow = j_yellow.template get<ns::Color>();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user