Update documentation

This commit is contained in:
Peter Dimov
2024-02-02 08:28:41 +02:00
parent 310bf1d544
commit 73de83b8f7
2 changed files with 36 additions and 0 deletions

View File

@ -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

View File

@ -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&
```