Skip to content

Commit

Permalink
Merge branch 'master' of github.com:DimanNe/result
Browse files Browse the repository at this point in the history
  • Loading branch information
DimanNe committed Oct 16, 2020
2 parents a80e63f + e77d3de commit 0a0c633
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,20 @@ TResult<int, std::string> ReadSettings(std::string_view FileName) {
```


In other words the following:
**In other words, the following:**
```
TOk Ok = co_await ExpressionOfTypeResult<TOk, TErr> . OrPrependErrMsgAndReturn();
```
will, depending on the contents of the Result expression
* either extract Ok value from it and assign it to the variable on the left
* or return from the function what is specified as parameter of `OrPrependErrMsgAndReturn()` function.
Note, in this implementation, there are a family of `OrReturn` functions: (1) `OrPrependErrMsgAndReturn(...)`
**will** (depending on the contents of the Result expression)
* either **extract Ok value from it and assign it to the variable on the left**
* or **return from the function** what is specified as parameter of `OrPrependErrMsgAndReturn()` function.
Note, in the implementation, there is a family of `Or..Return...` functions: (1) `OrPrependErrMsgAndReturn(...)`
(2) `OrReturnNewErr(...)`, (3) `OrReturn(...)`.



### `Result<Ok, Err>`

If you are wondering what the problems with exceptions are, you can start
If you are wondering what the problems with exceptions are, you can start, for example,
[here](https://www.reddit.com/r/cpp/comments/cliw5j/should_not_exceptions_be_finally_deprecated/).

0 comments on commit 0a0c633

Please sign in to comment.