Skip to content

Commit

Permalink
Merge pull request #439 from jaredgrubb/patch-2
Browse files Browse the repository at this point in the history
README: adjust boost::optional example
  • Loading branch information
nlohmann committed Jan 29, 2017
2 parents f642934 + f2873e6 commit affa3bf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,9 @@ namespace nlohmann {
}

static void from_json(const json& j, boost::optional<T>& opt) {
if (!j.is_null()) {
if (j.is_null()) {
opt = boost::none;
} else {
opt = j.get<T>(); // same as above, but with
// adl_serializer<T>::from_json
}
Expand Down

0 comments on commit affa3bf

Please sign in to comment.