Skip to content

Commit

Permalink
Fixed missing line in std::optional example
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastien Ponce authored and Sebastien Ponce committed Oct 2, 2024
1 parent 5cf64e7 commit 7f0e172
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions talk/morelanguage/morestl.tex
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
return in; // equiv. to optional<Phone>{in};
return {}; // or: return std::nullopt; (empty opt.)
}
auto v = parse_phone(...);
if (v) { // or: v.has_value()
process_phone(v.value()); // or: *v (unchecked)
v->call(); // calls Phone::call() (unchecked)
Expand Down

0 comments on commit 7f0e172

Please sign in to comment.