Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Feb 2, 2024
1 parent 310bf1d commit 73de83b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/system/changes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ https://www.boost.org/LICENSE_1_0.txt
* The deprecated header `boost/system/cygwin_error.hpp` has been removed.
* The original and obsolete (32 bit) MinGW is no longer supported. MinGW-w64 (both 64 and 32 bit) is still supported.
* `operator&` now works for `result<void>` (by way of taking a nullary function.)
* Added `operator|=` for `result`.
## Changes in Boost 1.84

Expand Down
35 changes: 35 additions & 0 deletions doc/system/reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2618,6 +2618,41 @@ int get_port()
}
```

#### operator|=

```
template<class T, class E, class U> result<T, E>& operator|=( result<T, E>& r, U&& u );
```
[none]
* {blank}
+
If `r` contains an error, assigns a value to it, constructed from `u`.
+
Effects: ::
If `r.has_value()` is `false`, assigns `u` to `r`.
Returns: ::
`r`.
Remarks: ::
Only enabled when `U` is convertible to `T`.

```
template<class T, class E, class F> result<T, E>& operator|=( result<T, E>& r, F&& f );
```
[none]
* {blank}
+
If `r` contains an error, assigns `f()` to it.
+
Effects: ::
If `r.has_value()` is `false`, assigns `f()` to `r`.
Returns: ::
`r`.
Remarks: ::
Only enabled when the type of `f()` is either
- convertible to `T` or
- an instance of `result` convertible to `result<T, E>`.


#### operator&

```
Expand Down

0 comments on commit 73de83b

Please sign in to comment.