Skip to content

Commit

Permalink
elaborate on optional/expected
Browse files Browse the repository at this point in the history
Co-authored-by: Jonathan Wakely <[email protected]>
  • Loading branch information
Eisenwave and jwakely authored Jan 24, 2024
1 parent 0a014c0 commit 1a077fd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions CppCoreGuidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -3333,6 +3333,7 @@ For example:
The overly generic `pair` and `tuple` should be used only when the value returned represents independent entities rather than an abstraction.

Another option is to use `optional<T>` or `expected<T, error_code>`, rather than `pair` or `tuple`.
When used appropriately these types convey more information about what the members mean than `pair<T, bool>` or `pair<T, error_code>` do.

##### Note

Expand Down

0 comments on commit 1a077fd

Please sign in to comment.