Skip to content

Commit

Permalink
fix has check logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jason.l committed Apr 16, 2023
1 parent 11634b3 commit faf95c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ output:


json x = vec;
if (!x[0].has()) {
if (x[0].has()) {
std::cout << x[0].get_string() << std::endl;
}

Expand All @@ -154,7 +154,7 @@ output:
obj.insert({"is_ok", false});

json p = obj;
if (!p["is_ok"].has()) {
if (p["is_ok"].has()) {
std::cout << p["is_ok"].get_bool() << std::endl;
}
```
Expand Down

0 comments on commit faf95c8

Please sign in to comment.