Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mistakes in README.md #35

Merged
merged 1 commit into from
Sep 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ The interface is the same as `std::optional`, but the following member functions
* `tl::optional<std::size_t> s = opt_string.map_or(&std::string::size, 0);`
- `map_or_else`: carries out a `map` if there is a value, otherwise returns the result of a given default function.
* `std::size_t get_default();`
* `tl::optional<std::size_t> s = opt_string.map_or(&std::string::size, get_default);`
* `tl::optional<std::size_t> s = opt_string.map_or_else(&std::string::size, get_default);`
- `conjunction`: returns the argument if a value is stored in the optional, otherwise an empty optional.
* `tl::make_optional(42).conjunction(13); //13`
* `tl::optional<int>){}.conjunction(13); //empty`
* `tl::optional<int>{}.conjunction(13); //empty`
- `disjunction`: returns the argument if the optional is empty, otherwise the current value.
* `tl::make_optional(42).disjunction(13); //42`
* `tl::optional<int>{}.disjunction(13); //13`
Expand All @@ -73,7 +73,7 @@ int i = 42;
tl::optional<int&> o = i;
*o == 42; //true
i = 12;
*o = 12; //true
*o == 12; //true
&*o == &i; //true
```

Expand Down