diff --git a/Readme.md b/Readme.md index 53ee710e6e8..d9d71c2050e 100644 --- a/Readme.md +++ b/Readme.md @@ -54,7 +54,8 @@ On Windows, simply download the raw file from above and place it wherever it sui - [ ] Disable develop to master branch merging - [x] Disable documentation updates by Travis - [ ] Disable boost-outcome auto-generation - - [ ] Fix all the broken links in the tutorial to the reference APIs + - [x] Fix all the broken links in the tutorial to the reference APIs + - [ ] Generate final gh-pages site using Linux, as Hugo on Windows makes borked output # Changes since v1: diff --git a/doc/html b/doc/html index 2c38cc365e6..b462c2d0471 160000 --- a/doc/html +++ b/doc/html @@ -1 +1 @@ -Subproject commit 2c38cc365e686412a43268c85f079a18e2762323 +Subproject commit b462c2d0471b82f4dd325eef23df77c15d2af9d8 diff --git a/doc/src/content/reference/_index.md b/doc/src/content/reference/_index.md index 3afc5044c58..66345777211 100644 --- a/doc/src/content/reference/_index.md +++ b/doc/src/content/reference/_index.md @@ -82,7 +82,7 @@ weight = 20 - [`error_code`](success_failure#standardese-outcome_v2_xxx__policy__error_code-T--T---) — Used by policies to extract a `std::error_code` from some input `T` via ADL discovery of some `make_error_code(T)` function. - - [`error_code_throw_as_system_error`](policies/outcome_error_code_throw_as_system_error#standardese-outcome_v2_xxx__policy__error_code_throw_as_system_error-T-EC-E-) — Policy interpreting `EC` as a type for which `trait::has_error_code_v` is true. + - [`error_code_throw_as_system_error`](policies/result_error_code_throw_as_system_error#standardese-outcome_v2_xxx__policy__error_code_throw_as_system_error-T-EC-) — Policy interpreting `EC` as a type for which `trait::has_error_code_v` is true. - [`exception_ptr`](success_failure#standardese-outcome_v2_xxx__policy__exception_ptr-T--T---) — Used by policies to extract a `std::exception_ptr` from some input `T` via ADL discovery of some `make_exception_ptr(T)` function. @@ -126,9 +126,9 @@ weight = 20 - [`failure_type`](success_failure#standardese-outcome_v2_xxx__failure_type-EC-E-) — Type sugar for implicitly constructing a `result<>` with a failure state of error code and exception. - - [`in_place_type`](doc_value_storage.md#standardese-outcome_v2_xxx__in_place_type) — Aliases `std::in_place_type` if on C++ 17 or later, else defined locally. + - `in_place_type` — Aliases `std::in_place_type` if on C++ 17 or later, else defined locally. - - [`in_place_type_t`](doc_value_storage.md#standardese-outcome_v2_xxx__in_place_type_t-T-) — Aliases `std::in_place_type_t` if on C++ 17 or later, else defined locally. + - `in_place_type_t` — Aliases `std::in_place_type_t` if on C++ 17 or later, else defined locally. - [`is_outcome`](outcome#standardese-outcome_v2_xxx__is_outcome-T-) — True if an outcome @@ -156,7 +156,7 @@ weight = 20 - [`success_type`](success_failure#standardese-outcome_v2_xxx__success_type-T-) — Type sugar for implicitly constructing a `result<>` with a successful state. - - [`swap`](outcome#standardese-outcome_v2_xxx__swap-R-S-P-N--outcome-R-S-P-N---outcome-R-S-P-N---) — Specialise swap for outcome. + - [`swap`](result#standardese-outcome_v2_xxx__swap-R-S-P--result-R-S-P---result-R-S-P---) — Specialise swap for result. - [`try_operation_return_as`](try#standardese-outcome_v2_xxx__try_operation_return_as-T--T---) — Customisation point for changing what the `OUTCOME_TRY` macros do. This function defaults to returning `std::forward(v).as_failure()`. diff --git a/doc/src/content/reference/iostream_support.md b/doc/src/content/reference/iostream_support.md index 59e1ed41666..3a2497b39b1 100644 --- a/doc/src/content/reference/iostream_support.md +++ b/doc/src/content/reference/iostream_support.md @@ -9,10 +9,10 @@ weight = 80
namespace outcome_v2_xxx
 {
     template <class R, class S, class P>
-    std::istream& operator>>(std::istream& s, result<R, S, P>& v);
+    std::istream& operator>>(std::istream& s, result<R, S, P>& v);
 
     template <class R, class S, class P>
-    std::ostream& operator<<(std::ostream& s, result<R, S, P> const& v);
+    std::ostream& operator<<(std::ostream& s, result<R, S, P> const& v);
 
     template <class R, class S, class P>
     std::string print('hidden' const& v);
@@ -27,13 +27,13 @@ weight = 80
     std::string print('hidden' const& v);
 
     template <class R, class S, class P, class N>
-    std::istream& operator>>(std::istream& s, outcome<R, S, P, N>& v);
+    std::istream& operator>>(std::istream& s, outcome<R, S, P, N>& v);
 
     template <class R, class S, class P, class N>
-    std::ostream& operator<<(std::ostream& s, outcome<R, S, P, N> const& v);
+    std::ostream& operator<<(std::ostream& s, outcome<R, S, P, N> const& v);
 
     template <class R, class S, class P, class N>
-    std::string print(outcome<R, S, P, N> const& v);
+    std::string print(outcome<R, S, P, N> const& v);
 }
 
@@ -44,7 +44,7 @@ weight = 80
template <class R, class S, class P>
-std::istream& operator>>(std::istream& s, result<R, S, P>& v);
+std::istream& operator>>(std::istream& s, result<R, S, P>& v);
 
Deserialise a result. Format is `status_unsigned [value][error]`. Spare storage is preserved. @@ -58,7 +58,7 @@ Deserialise a result. Format is `status_unsigned [value][error]`. Spare storage
template <class R, class S, class P>
-std::ostream& operator<<(std::ostream& s, result<R, S, P> const& v);
+std::ostream& operator<<(std::ostream& s, result<R, S, P> const& v);
 
Serialise a result. Format is `status_unsigned [value][error]`. Spare storage is preserved. @@ -122,7 +122,7 @@ Debug print a result into a form suitable for human reading. Format is `(+void)|
template <class R, class S, class P, class N>
-std::istream& operator>>(std::istream& s, outcome<R, S, P, N>& v);
+std::istream& operator>>(std::istream& s, outcome<R, S, P, N>& v);
 
Deserialise an outcome. Format is `status_unsigned [value][error][exception]`. Spare storage is preserved. @@ -136,7 +136,7 @@ Deserialise an outcome. Format is `status_unsigned [value][error][exception]`. S
template <class R, class S, class P, class N>
-std::ostream& operator<<(std::ostream& s, outcome<R, S, P, N> const& v);
+std::ostream& operator<<(std::ostream& s, outcome<R, S, P, N> const& v);
 
Serialise an outcome. Format is `status_unsigned [value][error][exception]`. Spare storage is preserved. @@ -152,7 +152,7 @@ If you are printing to a human readable destination, use `print()` instead.
template <class R, class S, class P, class N>
-std::string print(outcome<R, S, P, N> const& v);
+std::string print(outcome<R, S, P, N> const& v);
 
Debug print an outcome into a form suitable for human reading. Format is one of: diff --git a/doc/src/content/reference/outcome.md b/doc/src/content/reference/outcome.md index 367b2bf924b..33778451618 100644 --- a/doc/src/content/reference/outcome.md +++ b/doc/src/content/reference/outcome.md @@ -25,7 +25,7 @@ weight = 10         constexpr void hook_outcome_move_construction(T*, U&&) noexcept;         template <class T, class U, class ... Args> -        constexpr void hook_outcome_in_place_construction(T*, in_place_type_t<U>, Args &&...) noexcept; +        constexpr void hook_outcome_in_place_construction(T*, in_place_type_t<U>, Args &&...) noexcept;         template <class R, class S, class P, class NoValuePolicy, class U>         constexpr void override_outcome_exception(outcome<R, S, P, NoValuePolicy>* o, U&& v) noexcept; @@ -35,10 +35,10 @@ weight = 10     class outcome;     template <class T, class U, class V, class R, class S, class P, class N> -    constexpr bool operator==(result<T, U, V> const& a, outcome<R, S, P, N> const& b) noexcept('hidden'); +    constexpr bool operator==(result<T, U, V> const& a, outcome<R, S, P, N> const& b) noexcept('hidden');     template <class T, class U, class V, class R, class S, class P, class N> -    constexpr bool operator!=(result<T, U, V> const& a, outcome<R, S, P, N> const& b) noexcept('hidden'); +    constexpr bool operator!=(result<T, U, V> const& a, outcome<R, S, P, N> const& b) noexcept('hidden');     template <class R, class S, class P, class N>     void swap(outcome<R, S, P, N>& a, outcome<R, S, P, N>& b) noexcept('hidden'); @@ -137,7 +137,7 @@ WARNING: The compiler is permitted to elide calls to constructors, and thus this
template <class T, class U, class ... Args>
-constexpr void hook_outcome_in_place_construction(T*, in_place_type_t<U>, Args &&...) noexcept;
+constexpr void hook_outcome_in_place_construction(T*, in_place_type_t<U>, Args &&...) noexcept;
 
The default instantiation hook implementation called when a `outcome` is created by in place construction. Does nothing. @@ -217,63 +217,63 @@ Used in hook implementations to override the payload/exception to something othe     constexpr outcome(outcome<T, U, V, W>&& o) noexcept('hidden');     template <class T, class U, class V> -    constexpr outcome(result<T, U, V> const& o) noexcept('hidden'); +    constexpr outcome(result<T, U, V> const& o) noexcept('hidden');     template <class T, class U, class V> -    constexpr outcome(result<T, U, V>&& o) noexcept('hidden'); +    constexpr outcome(result<T, U, V>&& o) noexcept('hidden');     template <class ... Args> -    constexpr outcome(in_place_type_t<outcome_v2_xxx::outcome::value_type_if_enabled> _, Args &&... args) noexcept('hidden'); +    constexpr outcome(in_place_type_t<outcome_v2_xxx::outcome::value_type_if_enabled> _, Args &&... args) noexcept('hidden');     template <class U, class ... Args> -    constexpr outcome(in_place_type_t<outcome_v2_xxx::outcome::value_type_if_enabled> _, std::initializer_list<U> il, Args &&... args) noexcept('hidden'); +    constexpr outcome(in_place_type_t<outcome_v2_xxx::outcome::value_type_if_enabled> _, std::initializer_list<U> il, Args &&... args) noexcept('hidden');     template <class ... Args> -    constexpr outcome(in_place_type_t<outcome_v2_xxx::outcome::error_type_if_enabled> _, Args &&... args) noexcept('hidden'); +    constexpr outcome(in_place_type_t<outcome_v2_xxx::outcome::error_type_if_enabled> _, Args &&... args) noexcept('hidden');     template <class U, class ... Args> -    constexpr outcome(in_place_type_t<outcome_v2_xxx::outcome::error_type_if_enabled> _, std::initializer_list<U> il, Args &&... args) noexcept('hidden'); +    constexpr outcome(in_place_type_t<outcome_v2_xxx::outcome::error_type_if_enabled> _, std::initializer_list<U> il, Args &&... args) noexcept('hidden');     template <class ... Args> -    constexpr outcome(in_place_type_t<outcome_v2_xxx::outcome::exception_type_if_enabled>, Args &&... args) noexcept('hidden'); +    constexpr outcome(in_place_type_t<outcome_v2_xxx::outcome::exception_type_if_enabled>, Args &&... args) noexcept('hidden');     template <class U, class ... Args> -    constexpr outcome(in_place_type_t<outcome_v2_xxx::outcome::exception_type_if_enabled>, std::initializer_list<U> il, Args &&... args) noexcept('hidden'); +    constexpr outcome(in_place_type_t<outcome_v2_xxx::outcome::exception_type_if_enabled>, std::initializer_list<U> il, Args &&... args) noexcept('hidden');     template <class A1, class A2, class ... Args>     constexpr outcome(A1&& a1, A2&& a2, Args &&... args) noexcept('hidden'); -    constexpr outcome(success_type<void> const& o) noexcept('hidden'); +    constexpr outcome(success_type<void> const& o) noexcept('hidden');     template <class T> -    constexpr outcome(success_type<T> const& o) noexcept('hidden'); +    constexpr outcome(success_type<T> const& o) noexcept('hidden');     template <class T> -    constexpr outcome(success_type<T>&& o) noexcept('hidden'); +    constexpr outcome(success_type<T>&& o) noexcept('hidden');     template <class T, class U> -    constexpr outcome(failure_type<T, U> const& o) noexcept('hidden'); +    constexpr outcome(failure_type<T, U> const& o) noexcept('hidden');     template <class T, class U> -    constexpr outcome(failure_type<T, U>&& o) noexcept('hidden'); +    constexpr outcome(failure_type<T, U>&& o) noexcept('hidden');     template <class T, class U, class V, class W>     constexpr bool operator==(outcome<T, U, V, W> const& o) const noexcept('hidden');     template <class T, class U> -    constexpr bool operator==(failure_type<T, U> const& o) const noexcept('hidden'); +    constexpr bool operator==(failure_type<T, U> const& o) const noexcept('hidden');     template <class T, class U, class V, class W>     constexpr bool operator!=(outcome<T, U, V, W> const& o) const noexcept('hidden');     template <class T, class U> -    constexpr bool operator!=(failure_type<T, U> const& o) const noexcept('hidden'); +    constexpr bool operator!=(failure_type<T, U> const& o) const noexcept('hidden');     void swap(outcome<R, S, P, NoValuePolicy>& o) noexcept('hidden'); - failure_type<outcome_v2_xxx::outcome::error_type, outcome_v2_xxx::outcome::exception_type> as_failure() const &; + failure_type<outcome_v2_xxx::outcome::error_type, outcome_v2_xxx::outcome::exception_type> as_failure() const &; - failure_type<outcome_v2_xxx::outcome::error_type, outcome_v2_xxx::outcome::exception_type> as_failure() &&; + failure_type<outcome_v2_xxx::outcome::error_type, outcome_v2_xxx::outcome::exception_type> as_failure() &&;     using exception_type = std::exception_ptr; @@ -296,48 +296,48 @@ Used in hook implementations to override the payload/exception to something othe     using error_type = 'hidden'; //=== assume_error ===// -    constexpr error_type& assume_error() & noexcept; -    constexpr error_type& assume_error() const & noexcept; -    constexpr error_type&& assume_error() && noexcept; -    constexpr error_type&& assume_error() const && noexcept; +    constexpr error_type& assume_error() & noexcept; +    constexpr error_type& assume_error() const & noexcept; +    constexpr error_type&& assume_error() && noexcept; +    constexpr error_type&& assume_error() const && noexcept; //=== error ===// -    constexpr error_type& error() &; -    constexpr error_type& error() const &; -    constexpr error_type&& error() &&; -    constexpr error_type&& error() const &&; +    constexpr error_type& error() &; +    constexpr error_type& error() const &; +    constexpr error_type&& error() &&; +    constexpr error_type&& error() const &&;     explicit operator bool() const noexcept; -    constexpr bool has_value() const noexcept; +    constexpr bool has_value() const noexcept; -    constexpr bool has_error() const noexcept; +    constexpr bool has_error() const noexcept; -    constexpr bool has_exception() const noexcept; +    constexpr bool has_exception() const noexcept; -    constexpr bool has_failure() const noexcept; +    constexpr bool has_failure() const noexcept;     template <class T, class U, class V> -    constexpr bool operator==('hidden' const& o) const noexcept('hidden'); +    constexpr bool operator==('hidden' const& o) const noexcept('hidden');     template <class T> -    constexpr bool operator==(success_type<T> const& o) const noexcept('hidden'); +    constexpr bool operator==(success_type<T> const& o) const noexcept('hidden'); -    constexpr bool operator==(success_type<void> const& o) const noexcept; +    constexpr bool operator==(success_type<void> const& o) const noexcept;     template <class T> -    constexpr bool operator==(failure_type<T, void> const& o) const noexcept('hidden'); +    constexpr bool operator==(failure_type<T, void> const& o) const noexcept('hidden');     template <class T, class U, class V> -    constexpr bool operator!=('hidden' const& o) const noexcept('hidden'); +    constexpr bool operator!=('hidden' const& o) const noexcept('hidden');     template <class T> -    constexpr bool operator!=(success_type<T> const& o) const noexcept('hidden'); +    constexpr bool operator!=(success_type<T> const& o) const noexcept('hidden'); -    constexpr bool operator!=(success_type<void> const& o) const noexcept; +    constexpr bool operator!=(success_type<void> const& o) const noexcept;     template <class T> -    constexpr bool operator!=(failure_type<T, void> const& o) const noexcept('hidden'); +    constexpr bool operator!=(failure_type<T, void> const& o) const noexcept('hidden'); }; @@ -357,7 +357,7 @@ Similarly to `result`, `NoValuePolicy` defaults to a policy selected according t 1. If `.value()` called when there is no `value_type` but there is an `exception_type`: - - If {{" >}}d is true, then `std::rethrow_exception(exception()|make_exception_ptr(exception()))` \[{{">}}\] + - If {{" >}} is true, then `std::rethrow_exception(exception()|make_exception_ptr(exception()))` \[{{">}}\] 2. If `.value()` called when there is no `value_type` but there is an `error_type`: @@ -445,7 +445,7 @@ Access exception with runtime checks. ----- -### Function `outcome_v2_xxx::result::assume_error` +### Function `outcome_v2_xxx::outcome::assume_error` @@ -466,7 +466,7 @@ Access error without runtime checks. ----- -### Function `outcome_v2_xxx::result::error` +### Function `outcome_v2_xxx::outcome::error` @@ -487,7 +487,7 @@ Access error with runtime checks. ----- -### Conversion operator `outcome_v2_xxx::result::operator bool` +### Conversion operator `outcome_v2_xxx::outcome::operator bool` @@ -500,7 +500,7 @@ Checks if has value. ----- -### Function `outcome_v2_xxx::result::has_value` +### Function `outcome_v2_xxx::outcome::has_value` @@ -513,7 +513,7 @@ Checks if has value. ----- -### Function `outcome_v2_xxx::result::has_error` +### Function `outcome_v2_xxx::outcome::has_error` @@ -526,7 +526,7 @@ Checks if has error. ----- -### Function `outcome_v2_xxx::result::has_exception` +### Function `outcome_v2_xxx::outcome::has_exception` @@ -539,7 +539,7 @@ Checks if has exception. ----- -### Function `outcome_v2_xxx::result::has_failure` +### Function `outcome_v2_xxx::outcome::has_failure` @@ -552,12 +552,12 @@ Checks if has error or exception. ----- -### Function `outcome_v2_xxx::result::operator==` +### Function `outcome_v2_xxx::outcome::operator==`
template <class T, class U, class V>
-constexpr bool operator==('hidden' const& o) const noexcept('hidden');
+constexpr bool operator==('hidden' const& o) const noexcept('hidden');
 
True if equal to the other result. @@ -572,12 +572,12 @@ True if equal to the other result. ----- -### Function `outcome_v2_xxx::result::operator==` +### Function `outcome_v2_xxx::outcome::operator==`
template <class T>
-constexpr bool operator==(success_type<T> const& o) const noexcept('hidden');
+constexpr bool operator==(success_type<T> const& o) const noexcept('hidden');
 
True if equal to the success type sugar. @@ -592,11 +592,11 @@ True if equal to the success type sugar. ----- -### Function `outcome_v2_xxx::result::operator==` +### Function `outcome_v2_xxx::outcome::operator==` -
constexpr bool operator==(success_type<void> const& o) const noexcept;
+
constexpr bool operator==(success_type<void> const& o) const noexcept;
 
True if equal to the success type sugar. @@ -611,12 +611,12 @@ True if equal to the success type sugar. ----- -### Function `outcome_v2_xxx::result::operator==` +### Function `outcome_v2_xxx::outcome::operator==`
template <class T>
-constexpr bool operator==(failure_type<T, void> const& o) const noexcept('hidden');
+constexpr bool operator==(failure_type<T, void> const& o) const noexcept('hidden');
 
True if equal to the failure type sugar. @@ -636,7 +636,7 @@ True if equal to the failure type sugar.
template <class T, class U, class V>
-constexpr bool operator!=('hidden' const& o) const noexcept('hidden');
+constexpr bool operator!=('hidden' const& o) const noexcept('hidden');
 
True if not equal to the other result. @@ -656,7 +656,7 @@ True if not equal to the other result.
template <class T>
-constexpr bool operator!=(success_type<T> const& o) const noexcept('hidden');
+constexpr bool operator!=(success_type<T> const& o) const noexcept('hidden');
 
True if not equal to the success type sugar. @@ -675,7 +675,7 @@ True if not equal to the success type sugar. -
constexpr bool operator!=(success_type<void> const& o) const noexcept;
+
constexpr bool operator!=(success_type<void> const& o) const noexcept;
 
True if not equal to the success type sugar. @@ -690,12 +690,12 @@ True if not equal to the success type sugar. ----- -### Function `outcome_v2_xxx::result::operator!=` +### Function `outcome_v2_xxx::outcome::operator!=`
template <class T>
-constexpr bool operator!=(failure_type<T, void> const& o) const noexcept('hidden');
+constexpr bool operator!=(failure_type<T, void> const& o) const noexcept('hidden');
 
True if not equal to the failure type sugar. @@ -1057,7 +1057,7 @@ Explicit converting move constructor from a compatible outcome type.
template <class T, class U, class V>
-constexpr outcome(result<T, U, V> const& o) noexcept('hidden');
+constexpr outcome(result<T, U, V> const& o) noexcept('hidden');
 
Explicit converting copy constructor from a compatible result type. @@ -1079,7 +1079,7 @@ Explicit converting copy constructor from a compatible result type.
template <class T, class U, class V>
-constexpr outcome(result<T, U, V>&& o) noexcept('hidden');
+constexpr outcome(result<T, U, V>&& o) noexcept('hidden');
 
Explicit converting move constructor from a compatible result type. @@ -1101,7 +1101,7 @@ Explicit converting move constructor from a compatible result type.
template <class ... Args>
-constexpr outcome(in_place_type_t<outcome_v2_xxx::outcome::value_type_if_enabled> _, Args &&... args) noexcept('hidden');
+constexpr outcome(in_place_type_t<outcome_v2_xxx::outcome::value_type_if_enabled> _, Args &&... args) noexcept('hidden');
 
Inplace constructor to a successful value. @@ -1124,7 +1124,7 @@ Inplace constructor to a successful value.
template <class U, class ... Args>
-constexpr outcome(in_place_type_t<outcome_v2_xxx::outcome::value_type_if_enabled> _, std::initializer_list<U> il, Args &&... args) noexcept('hidden');
+constexpr outcome(in_place_type_t<outcome_v2_xxx::outcome::value_type_if_enabled> _, std::initializer_list<U> il, Args &&... args) noexcept('hidden');
 
Inplace constructor to a successful value. @@ -1148,7 +1148,7 @@ Inplace constructor to a successful value.
template <class ... Args>
-constexpr outcome(in_place_type_t<outcome_v2_xxx::outcome::error_type_if_enabled> _, Args &&... args) noexcept('hidden');
+constexpr outcome(in_place_type_t<outcome_v2_xxx::outcome::error_type_if_enabled> _, Args &&... args) noexcept('hidden');
 
Inplace constructor to an unsuccessful error. @@ -1171,7 +1171,7 @@ Inplace constructor to an unsuccessful error.
template <class U, class ... Args>
-constexpr outcome(in_place_type_t<outcome_v2_xxx::outcome::error_type_if_enabled> _, std::initializer_list<U> il, Args &&... args) noexcept('hidden');
+constexpr outcome(in_place_type_t<outcome_v2_xxx::outcome::error_type_if_enabled> _, std::initializer_list<U> il, Args &&... args) noexcept('hidden');
 
Inplace constructor to an unsuccessful error. @@ -1195,7 +1195,7 @@ Inplace constructor to an unsuccessful error.
template <class ... Args>
-constexpr outcome(in_place_type_t<outcome_v2_xxx::outcome::exception_type_if_enabled>, Args &&... args) noexcept('hidden');
+constexpr outcome(in_place_type_t<outcome_v2_xxx::outcome::exception_type_if_enabled>, Args &&... args) noexcept('hidden');
 
Inplace constructor to an unsuccessful exception. @@ -1217,7 +1217,7 @@ Inplace constructor to an unsuccessful exception.
template <class U, class ... Args>
-constexpr outcome(in_place_type_t<outcome_v2_xxx::outcome::exception_type_if_enabled>, std::initializer_list<U> il, Args &&... args) noexcept('hidden');
+constexpr outcome(in_place_type_t<outcome_v2_xxx::outcome::exception_type_if_enabled>, std::initializer_list<U> il, Args &&... args) noexcept('hidden');
 
Inplace constructor to an unsuccessful exception. @@ -1261,7 +1261,7 @@ Implicit inplace constructor to successful value, or unsuccessful error, or unsu -
constexpr outcome(success_type<void> const& o) noexcept('hidden');
+
constexpr outcome(success_type<void> const& o) noexcept('hidden');
 
Implicit tagged constructor of a successful outcome. @@ -1283,7 +1283,7 @@ Implicit tagged constructor of a successful outcome.
template <class T>
-constexpr outcome(success_type<T> const& o) noexcept('hidden');
+constexpr outcome(success_type<T> const& o) noexcept('hidden');
 
Implicit tagged constructor of a successful outcome. @@ -1305,7 +1305,7 @@ Implicit tagged constructor of a successful outcome.
template <class T>
-constexpr outcome(success_type<T>&& o) noexcept('hidden');
+constexpr outcome(success_type<T>&& o) noexcept('hidden');
 
Implicit tagged constructor of a successful outcome. @@ -1327,7 +1327,7 @@ Implicit tagged constructor of a successful outcome.
template <class T, class U>
-constexpr outcome(failure_type<T, U> const& o) noexcept('hidden');
+constexpr outcome(failure_type<T, U> const& o) noexcept('hidden');
 
Implicit tagged constructor of a failure outcome. @@ -1349,7 +1349,7 @@ Implicit tagged constructor of a failure outcome.
template <class T, class U>
-constexpr outcome(failure_type<T, U>&& o) noexcept('hidden');
+constexpr outcome(failure_type<T, U>&& o) noexcept('hidden');
 
Implicit tagged constructor of a failure outcome. @@ -1391,7 +1391,7 @@ True if equal to the other outcome.
template <class T, class U>
-constexpr bool operator==(failure_type<T, U> const& o) const noexcept('hidden');
+constexpr bool operator==(failure_type<T, U> const& o) const noexcept('hidden');
 
True if equal to the failure type sugar. @@ -1431,7 +1431,7 @@ True if not equal to the other outcome.
template <class T, class U>
-constexpr bool operator!=(failure_type<T, U> const& o) const noexcept('hidden');
+constexpr bool operator!=(failure_type<T, U> const& o) const noexcept('hidden');
 
True if not equal to the failure type sugar. @@ -1463,7 +1463,7 @@ Swaps this result with another result -
failure_type<outcome_v2_xxx::outcome::error_type, outcome_v2_xxx::outcome::exception_type> as_failure() const &;
+
failure_type<outcome_v2_xxx::outcome::error_type, outcome_v2_xxx::outcome::exception_type> as_failure() const &;
 
Returns this outcome as a `failure_type` with any errored and/or excepted state copied. @@ -1476,7 +1476,7 @@ Returns this outcome as a `failure_type` with any errored and/or excepted state -
failure_type<outcome_v2_xxx::outcome::error_type, outcome_v2_xxx::outcome::exception_type> as_failure() &&;
+
failure_type<outcome_v2_xxx::outcome::error_type, outcome_v2_xxx::outcome::exception_type> as_failure() &&;
 
Returns this outcome as a `failure_type` with any errored and/or excepted state moved. @@ -1492,7 +1492,7 @@ Returns this outcome as a `failure_type` with any errored and/or excepted state
template <class T, class U, class V, class R, class S, class P, class N>
-constexpr bool operator==(result<T, U, V> const& a, outcome<R, S, P, N> const& b) noexcept('hidden');
+constexpr bool operator==(result<T, U, V> const& a, outcome<R, S, P, N> const& b) noexcept('hidden');
 
True if the result is equal to the outcome @@ -1515,7 +1515,7 @@ True if the result is equal to the outcome
template <class T, class U, class V, class R, class S, class P, class N>
-constexpr bool operator!=(result<T, U, V> const& a, outcome<R, S, P, N> const& b) noexcept('hidden');
+constexpr bool operator!=(result<T, U, V> const& a, outcome<R, S, P, N> const& b) noexcept('hidden');
 
True if the result is not equal to the outcome diff --git a/doc/src/content/reference/policies/all_narrow.md b/doc/src/content/reference/policies/all_narrow.md index 28485938c3b..2a49378a7d6 100644 --- a/doc/src/content/reference/policies/all_narrow.md +++ b/doc/src/content/reference/policies/all_narrow.md @@ -6,7 +6,7 @@ weight = 10 -
#include "detail/common.hpp"
+
#include "detail/common.hpp"
 
 namespace outcome_v2_xxx
 {
@@ -37,13 +37,13 @@ weight = 10
     static constexpr void wide_exception_check(Impl&& self);
 
     template <class Impl>
-    static constexpr void narrow_value_check(Impl&& self) noexcept;
+    static constexpr void narrow_value_check(Impl&& self) noexcept;
 
     template <class Impl>
-    static constexpr void narrow_error_check(Impl&& self) noexcept;
+    static constexpr void narrow_error_check(Impl&& self) noexcept;
 
     template <class Impl>
-    static constexpr void narrow_exception_check(Impl&& self) noexcept;
+    static constexpr void narrow_exception_check(Impl&& self) noexcept;
 };
 
diff --git a/doc/src/content/reference/policies/outcome_error_code_throw_as_system_error.md b/doc/src/content/reference/policies/outcome_error_code_throw_as_system_error.md index a292980b882..09bdd7f8fa2 100644 --- a/doc/src/content/reference/policies/outcome_error_code_throw_as_system_error.md +++ b/doc/src/content/reference/policies/outcome_error_code_throw_as_system_error.md @@ -6,7 +6,7 @@ weight = 20 -
#include "result_error_code_throw_as_system_error.hpp"
+
#include "result_error_code_throw_as_system_error.hpp"
 
 namespace outcome_v2_xxx
 {
@@ -39,13 +39,13 @@ weight = 20
     static constexpr void wide_exception_check(Impl&& self);
 
     template <class Impl>
-    static constexpr void narrow_value_check(Impl&& self) noexcept;
+    static constexpr void narrow_value_check(Impl&& self) noexcept;
 
     template <class Impl>
-    static constexpr void narrow_error_check(Impl&& self) noexcept;
+    static constexpr void narrow_error_check(Impl&& self) noexcept;
 
     template <class Impl>
-    static constexpr void narrow_exception_check(Impl&& self) noexcept;
+    static constexpr void narrow_exception_check(Impl&& self) noexcept;
 };
 
diff --git a/doc/src/content/reference/policies/outcome_exception_ptr_rethrow.md b/doc/src/content/reference/policies/outcome_exception_ptr_rethrow.md index 2e0cd9be820..98e1db37f90 100644 --- a/doc/src/content/reference/policies/outcome_exception_ptr_rethrow.md +++ b/doc/src/content/reference/policies/outcome_exception_ptr_rethrow.md @@ -6,7 +6,7 @@ weight = 40 -
#include "result_exception_ptr_rethrow.hpp"
+
#include "result_exception_ptr_rethrow.hpp"
 
 namespace outcome_v2_xxx
 {
@@ -39,13 +39,13 @@ weight = 40
     static constexpr void wide_exception_check(Impl&& self);
 
     template <class Impl>
-    static constexpr void narrow_value_check(Impl&& self) noexcept;
+    static constexpr void narrow_value_check(Impl&& self) noexcept;
 
     template <class Impl>
-    static constexpr void narrow_error_check(Impl&& self) noexcept;
+    static constexpr void narrow_error_check(Impl&& self) noexcept;
 
     template <class Impl>
-    static constexpr void narrow_exception_check(Impl&& self) noexcept;
+    static constexpr void narrow_exception_check(Impl&& self) noexcept;
 };
 
diff --git a/doc/src/content/reference/policies/result_error_code_throw_as_system_error.md b/doc/src/content/reference/policies/result_error_code_throw_as_system_error.md index 9e3f2b6df75..9a09363288a 100644 --- a/doc/src/content/reference/policies/result_error_code_throw_as_system_error.md +++ b/doc/src/content/reference/policies/result_error_code_throw_as_system_error.md @@ -6,14 +6,14 @@ weight = 30 -
#include "detail/common.hpp"
+
#include "detail/common.hpp"
 
 namespace outcome_v2_xxx
 {
     namespace policy
     {
         template <class T, class EC>
-        struct error_code_throw_as_system_error<T, EC, void>;
+        struct error_code_throw_as_system_error<T, EC, void>;
     }
 }
 
@@ -27,7 +27,7 @@ weight = 30
template <class T, class EC>
-struct error_code_throw_as_system_error<T, EC, void>
+struct error_code_throw_as_system_error<T, EC, void>
 {
     template <class Impl>
     static constexpr void wide_value_check(Impl&& self);
@@ -36,13 +36,13 @@ weight = 30
     static constexpr void wide_error_check(Impl&& self);
 
     template <class Impl>
-    static constexpr void narrow_value_check(Impl&& self) noexcept;
+    static constexpr void narrow_value_check(Impl&& self) noexcept;
 
     template <class Impl>
-    static constexpr void narrow_error_check(Impl&& self) noexcept;
+    static constexpr void narrow_error_check(Impl&& self) noexcept;
 
     template <class Impl>
-    static constexpr void narrow_exception_check(Impl&& self) noexcept;
+    static constexpr void narrow_exception_check(Impl&& self) noexcept;
 };
 
diff --git a/doc/src/content/reference/policies/result_exception_ptr_rethrow.md b/doc/src/content/reference/policies/result_exception_ptr_rethrow.md index 681c9666a5e..fa4aab8e52b 100644 --- a/doc/src/content/reference/policies/result_exception_ptr_rethrow.md +++ b/doc/src/content/reference/policies/result_exception_ptr_rethrow.md @@ -6,17 +6,17 @@ weight = 50 -
#include "detail/common.hpp"
+
#include "detail/common.hpp"
 
 namespace outcome_v2_xxx
 {
     namespace policy
     {
         template <class T, class EC, class E>
-        struct exception_ptr_rethrow;
+        struct exception_ptr_rethrow;
 
         template <class T, class EC>
-        struct exception_ptr_rethrow<T, EC, void>;
+        struct exception_ptr_rethrow<T, EC, void>;
     }
 }
 
diff --git a/doc/src/content/reference/policies/terminate.md b/doc/src/content/reference/policies/terminate.md index eb23f16c7c7..79536d81058 100644 --- a/doc/src/content/reference/policies/terminate.md +++ b/doc/src/content/reference/policies/terminate.md @@ -6,7 +6,7 @@ weight = 60 -
#include "detail/common.hpp"
+
#include "detail/common.hpp"
 
 namespace outcome_v2_xxx
 {
@@ -37,13 +37,13 @@ weight = 60
     static constexpr void wide_exception_check(Impl&& self);
 
     template <class Impl>
-    static constexpr void narrow_value_check(Impl&& self) noexcept;
+    static constexpr void narrow_value_check(Impl&& self) noexcept;
 
     template <class Impl>
-    static constexpr void narrow_error_check(Impl&& self) noexcept;
+    static constexpr void narrow_error_check(Impl&& self) noexcept;
 
     template <class Impl>
-    static constexpr void narrow_exception_check(Impl&& self) noexcept;
+    static constexpr void narrow_exception_check(Impl&& self) noexcept;
 };
 
diff --git a/doc/src/content/reference/policies/throw_bad_result_access.md b/doc/src/content/reference/policies/throw_bad_result_access.md index f341e7640ec..1646ac1ffd7 100644 --- a/doc/src/content/reference/policies/throw_bad_result_access.md +++ b/doc/src/content/reference/policies/throw_bad_result_access.md @@ -6,7 +6,7 @@ weight = 70 -
#include "detail/common.hpp"
+
#include "detail/common.hpp"
 
 namespace outcome_v2_xxx
 {
@@ -39,13 +39,13 @@ weight = 70
     static constexpr void wide_exception_check(Impl&& self);
 
     template <class Impl>
-    static constexpr void narrow_value_check(Impl&& self) noexcept;
+    static constexpr void narrow_value_check(Impl&& self) noexcept;
 
     template <class Impl>
-    static constexpr void narrow_error_check(Impl&& self) noexcept;
+    static constexpr void narrow_error_check(Impl&& self) noexcept;
 
     template <class Impl>
-    static constexpr void narrow_exception_check(Impl&& self) noexcept;
+    static constexpr void narrow_exception_check(Impl&& self) noexcept;
 };
 
diff --git a/doc/src/content/reference/result.md b/doc/src/content/reference/result.md index e1d6e2ff106..12e300606b9 100644 --- a/doc/src/content/reference/result.md +++ b/doc/src/content/reference/result.md @@ -31,7 +31,7 @@ weight = 20         constexpr void hook_result_move_construction(T*, U&&) noexcept;         template <class T, class U, class ... Args> -        constexpr void hook_result_in_place_construction(T*, in_place_type_t<U>, Args &&...) noexcept; +        constexpr void hook_result_in_place_construction(T*, in_place_type_t<U>, Args &&...) noexcept;         template <class R, class S, class NoValuePolicy>         constexpr uint16_t spare_storage('hidden' const* r) noexcept; @@ -158,7 +158,7 @@ WARNING: The compiler is permitted to elide calls to constructors, and thus this
template <class T, class U, class ... Args>
-constexpr void hook_result_in_place_construction(T*, in_place_type_t<U>, Args &&...) noexcept;
+constexpr void hook_result_in_place_construction(T*, in_place_type_t<U>, Args &&...) noexcept;
 
The default instantiation hook implementation called when a `result` is created by in place construction. Does nothing. @@ -252,33 +252,33 @@ Sets the 16 bits of spare storage in result/outcome.     constexpr result(result<T, U, V>&& o) noexcept('hidden');     template <class ... Args> -    constexpr result(in_place_type_t<outcome_v2_xxx::result::value_type_if_enabled> _, Args &&... args) noexcept('hidden'); +    constexpr result(in_place_type_t<outcome_v2_xxx::result::value_type_if_enabled> _, Args &&... args) noexcept('hidden');     template <class U, class ... Args> -    constexpr result(in_place_type_t<outcome_v2_xxx::result::value_type_if_enabled> _, std::initializer_list<U> il, Args &&... args) noexcept('hidden'); +    constexpr result(in_place_type_t<outcome_v2_xxx::result::value_type_if_enabled> _, std::initializer_list<U> il, Args &&... args) noexcept('hidden');     template <class ... Args> -    constexpr result(in_place_type_t<outcome_v2_xxx::result::error_type_if_enabled> _, Args &&... args) noexcept('hidden'); +    constexpr result(in_place_type_t<outcome_v2_xxx::result::error_type_if_enabled> _, Args &&... args) noexcept('hidden');     template <class U, class ... Args> -    constexpr result(in_place_type_t<outcome_v2_xxx::result::error_type_if_enabled> _, std::initializer_list<U> il, Args &&... args) noexcept('hidden'); +    constexpr result(in_place_type_t<outcome_v2_xxx::result::error_type_if_enabled> _, std::initializer_list<U> il, Args &&... args) noexcept('hidden');     template <class A1, class A2, class ... Args>     constexpr result(A1&& a1, A2&& a2, Args &&... args) noexcept('hidden'); -    constexpr result(success_type<void> const& o) noexcept('hidden'); +    constexpr result(success_type<void> const& o) noexcept('hidden');     template <class T> -    constexpr result(success_type<T> const& o) noexcept('hidden'); +    constexpr result(success_type<T> const& o) noexcept('hidden');     template <class T> -    constexpr result(success_type<T>&& o) noexcept('hidden'); +    constexpr result(success_type<T>&& o) noexcept('hidden');     template <class T> -    constexpr result(failure_type<T> const& o) noexcept('hidden'); +    constexpr result(failure_type<T> const& o) noexcept('hidden');     template <class T> -    constexpr result(failure_type<T>&& o) noexcept('hidden'); +    constexpr result(failure_type<T>&& o) noexcept('hidden');     void swap(result<R, S, NoValuePolicy>& o) noexcept('hidden'); @@ -289,48 +289,48 @@ Sets the 16 bits of spare storage in result/outcome.     using error_type = 'hidden'; //=== assume_error ===// -    constexpr error_type& assume_error() & noexcept; -    constexpr error_type& assume_error() const & noexcept; -    constexpr error_type&& assume_error() && noexcept; -    constexpr error_type&& assume_error() const && noexcept; +    constexpr error_type& assume_error() & noexcept; +    constexpr error_type& assume_error() const & noexcept; +    constexpr error_type&& assume_error() && noexcept; +    constexpr error_type&& assume_error() const && noexcept; //=== error ===// -    constexpr error_type& error() &; -    constexpr error_type& error() const &; -    constexpr error_type&& error() &&; -    constexpr error_type&& error() const &&; +    constexpr error_type& error() &; +    constexpr error_type& error() const &; +    constexpr error_type&& error() &&; +    constexpr error_type&& error() const &&;     explicit operator bool() const noexcept; -    constexpr bool has_value() const noexcept; +    constexpr bool has_value() const noexcept; -    constexpr bool has_error() const noexcept; +    constexpr bool has_error() const noexcept; -    constexpr bool has_exception() const noexcept; +    constexpr bool has_exception() const noexcept; -    constexpr bool has_failure() const noexcept; +    constexpr bool has_failure() const noexcept;     template <class T, class U, class V> -    constexpr bool operator==('hidden' const& o) const noexcept('hidden'); +    constexpr bool operator==('hidden' const& o) const noexcept('hidden');     template <class T> -    constexpr bool operator==(success_type<T> const& o) const noexcept('hidden'); +    constexpr bool operator==(success_type<T> const& o) const noexcept('hidden'); -    constexpr bool operator==(success_type<void> const& o) const noexcept; +    constexpr bool operator==(success_type<void> const& o) const noexcept;     template <class T> -    constexpr bool operator==(failure_type<T, void> const& o) const noexcept('hidden'); +    constexpr bool operator==(failure_type<T, void> const& o) const noexcept('hidden');     template <class T, class U, class V> -    constexpr bool operator!=('hidden' const& o) const noexcept('hidden'); +    constexpr bool operator!=('hidden' const& o) const noexcept('hidden');     template <class T> -    constexpr bool operator!=(success_type<T> const& o) const noexcept('hidden'); +    constexpr bool operator!=(success_type<T> const& o) const noexcept('hidden'); -    constexpr bool operator!=(success_type<void> const& o) const noexcept; +    constexpr bool operator!=(success_type<void> const& o) const noexcept;     template <class T> -    constexpr bool operator!=(failure_type<T, void> const& o) const noexcept('hidden'); +    constexpr bool operator!=(failure_type<T, void> const& o) const noexcept('hidden'); };
@@ -362,7 +362,7 @@ Any `R` (`value_type`) state can be observed using the member functions `.value( - `S` — The optional type of the failure result (use `void` to disable). Must be either `void` or `DefaultConstructible`. Cannot be a reference, a `in_place_type_t<>`, `success<>`, `failure<>`, an array, a function or non-destructible. - `NoValuePolicy` — Policy on how to interpret type `S` when a wide observation of a not present value occurs. -### Function `outcome_v2_xxx::result::assume_error` +### Function `outcome_v2_xxx::outcome::assume_error` @@ -383,7 +383,7 @@ Access error without runtime checks. ----- -### Function `outcome_v2_xxx::result::error` +### Function `outcome_v2_xxx::outcome::error` @@ -404,7 +404,7 @@ Access error with runtime checks. ----- -### Conversion operator `outcome_v2_xxx::result::operator bool` +### Conversion operator `outcome_v2_xxx::outcome::operator bool` @@ -417,7 +417,7 @@ Checks if has value. ----- -### Function `outcome_v2_xxx::result::has_value` +### Function `outcome_v2_xxx::outcome::has_value` @@ -430,7 +430,7 @@ Checks if has value. ----- -### Function `outcome_v2_xxx::result::has_error` +### Function `outcome_v2_xxx::outcome::has_error` @@ -443,7 +443,7 @@ Checks if has error. ----- -### Function `outcome_v2_xxx::result::has_exception` +### Function `outcome_v2_xxx::outcome::has_exception` @@ -456,7 +456,7 @@ Checks if has exception. ----- -### Function `outcome_v2_xxx::result::has_failure` +### Function `outcome_v2_xxx::outcome::has_failure` @@ -469,12 +469,12 @@ Checks if has error or exception. ----- -### Function `outcome_v2_xxx::result::operator==` +### Function `outcome_v2_xxx::outcome::operator==`
template <class T, class U, class V>
-constexpr bool operator==('hidden' const& o) const noexcept('hidden');
+constexpr bool operator==('hidden' const& o) const noexcept('hidden');
 
True if equal to the other result. @@ -489,12 +489,12 @@ True if equal to the other result. ----- -### Function `outcome_v2_xxx::result::operator==` +### Function `outcome_v2_xxx::outcome::operator==`
template <class T>
-constexpr bool operator==(success_type<T> const& o) const noexcept('hidden');
+constexpr bool operator==(success_type<T> const& o) const noexcept('hidden');
 
True if equal to the success type sugar. @@ -509,11 +509,11 @@ True if equal to the success type sugar. ----- -### Function `outcome_v2_xxx::result::operator==` +### Function `outcome_v2_xxx::outcome::operator==` -
constexpr bool operator==(success_type<void> const& o) const noexcept;
+
constexpr bool operator==(success_type<void> const& o) const noexcept;
 
True if equal to the success type sugar. @@ -528,12 +528,12 @@ True if equal to the success type sugar. ----- -### Function `outcome_v2_xxx::result::operator==` +### Function `outcome_v2_xxx::outcome::operator==`
template <class T>
-constexpr bool operator==(failure_type<T, void> const& o) const noexcept('hidden');
+constexpr bool operator==(failure_type<T, void> const& o) const noexcept('hidden');
 
True if equal to the failure type sugar. @@ -553,7 +553,7 @@ True if equal to the failure type sugar.
template <class T, class U, class V>
-constexpr bool operator!=('hidden' const& o) const noexcept('hidden');
+constexpr bool operator!=('hidden' const& o) const noexcept('hidden');
 
True if not equal to the other result. @@ -573,7 +573,7 @@ True if not equal to the other result.
template <class T>
-constexpr bool operator!=(success_type<T> const& o) const noexcept('hidden');
+constexpr bool operator!=(success_type<T> const& o) const noexcept('hidden');
 
True if not equal to the success type sugar. @@ -592,7 +592,7 @@ True if not equal to the success type sugar. -
constexpr bool operator!=(success_type<void> const& o) const noexcept;
+
constexpr bool operator!=(success_type<void> const& o) const noexcept;
 
True if not equal to the success type sugar. @@ -607,12 +607,12 @@ True if not equal to the success type sugar. ----- -### Function `outcome_v2_xxx::result::operator!=` +### Function `outcome_v2_xxx::outcome::operator!=`
template <class T>
-constexpr bool operator!=(failure_type<T, void> const& o) const noexcept('hidden');
+constexpr bool operator!=(failure_type<T, void> const& o) const noexcept('hidden');
 
True if not equal to the failure type sugar. @@ -970,7 +970,7 @@ Explicit converting move constructor from a compatible result type.
template <class ... Args>
-constexpr result(in_place_type_t<outcome_v2_xxx::result::value_type_if_enabled> _, Args &&... args) noexcept('hidden');
+constexpr result(in_place_type_t<outcome_v2_xxx::result::value_type_if_enabled> _, Args &&... args) noexcept('hidden');
 
Explicit inplace constructor to a successful result. @@ -993,7 +993,7 @@ Explicit inplace constructor to a successful result.
template <class U, class ... Args>
-constexpr result(in_place_type_t<outcome_v2_xxx::result::value_type_if_enabled> _, std::initializer_list<U> il, Args &&... args) noexcept('hidden');
+constexpr result(in_place_type_t<outcome_v2_xxx::result::value_type_if_enabled> _, std::initializer_list<U> il, Args &&... args) noexcept('hidden');
 
Explicit inplace constructor to a successful result. @@ -1017,7 +1017,7 @@ Explicit inplace constructor to a successful result.
template <class ... Args>
-constexpr result(in_place_type_t<outcome_v2_xxx::result::error_type_if_enabled> _, Args &&... args) noexcept('hidden');
+constexpr result(in_place_type_t<outcome_v2_xxx::result::error_type_if_enabled> _, Args &&... args) noexcept('hidden');
 
Explicit inplace constructor to a failure result. @@ -1040,7 +1040,7 @@ Explicit inplace constructor to a failure result.
template <class U, class ... Args>
-constexpr result(in_place_type_t<outcome_v2_xxx::result::error_type_if_enabled> _, std::initializer_list<U> il, Args &&... args) noexcept('hidden');
+constexpr result(in_place_type_t<outcome_v2_xxx::result::error_type_if_enabled> _, std::initializer_list<U> il, Args &&... args) noexcept('hidden');
 
Explicit inplace constructor to a failure result. @@ -1085,7 +1085,7 @@ Implicit inplace constructor to successful or failure result. -
constexpr result(success_type<void> const& o) noexcept('hidden');
+
constexpr result(success_type<void> const& o) noexcept('hidden');
 
Implicit tagged constructor of a successful result. @@ -1107,7 +1107,7 @@ Implicit tagged constructor of a successful result.
template <class T>
-constexpr result(success_type<T> const& o) noexcept('hidden');
+constexpr result(success_type<T> const& o) noexcept('hidden');
 
Implicit tagged constructor of a successful result. @@ -1129,7 +1129,7 @@ Implicit tagged constructor of a successful result.
template <class T>
-constexpr result(success_type<T>&& o) noexcept('hidden');
+constexpr result(success_type<T>&& o) noexcept('hidden');
 
Implicit tagged constructor of a successful result. @@ -1151,7 +1151,7 @@ Implicit tagged constructor of a successful result.
template <class T>
-constexpr result(failure_type<T> const& o) noexcept('hidden');
+constexpr result(failure_type<T> const& o) noexcept('hidden');
 
Implicit tagged constructor of a failure result. @@ -1173,7 +1173,7 @@ Implicit tagged constructor of a failure result.
template <class T>
-constexpr result(failure_type<T>&& o) noexcept('hidden');
+constexpr result(failure_type<T>&& o) noexcept('hidden');
 
Implicit tagged constructor of a failure result. diff --git a/doc/src/content/tutorial/default-actions/unchecked.md b/doc/src/content/tutorial/default-actions/unchecked.md index 3da3ef6bc93..f5285c2277e 100644 --- a/doc/src/content/tutorial/default-actions/unchecked.md +++ b/doc/src/content/tutorial/default-actions/unchecked.md @@ -10,16 +10,16 @@ various default actions upon no-value observation according to traits defined up If you don't want all this clever automatic detection of traits, and just want a plain, always-undefined-behaviour-on-no-value-observation success-or-failure type, we provide -a simplified template alias to `result` called {{< api "result/#standardese-outcome_v2_xxx::unchecked%3CR,S%3E" "unchecked" >}}. It literally does +a simplified template alias to `result` called {{< api "result/#standardese-outcome_v2_xxx__unchecked-R-S-" "unchecked" >}}. It literally does no run time checking whatsoever, no-value observation is always undefined behaviour. If instead you would prefer a plain, always-throwing-logic-error-on-no-value-observation -type, we also provide another simplified template alias to `result` called {{< api "result/#standardese-outcome_v2_xxx::checked%3CR,S%3E" "checked" >}}. +type, we also provide another simplified template alias to `result` called {{< api "result/#standardese-outcome_v2_xxx__checked-R-S-" "checked" >}}. Similar to `.value()` in the WG21 Expected proposal or Optional, no-value observation throws these logic error type exceptions: -- No-value `.value()` observation throws {{< api "bad_access/#standardese-outcome_v2_xxx::bad_result_access_with%3CS%3E" "bad_result_access_with" >}}. -- No-error `.error()` observation throws {{< api "bad_access/#standardese-outcome_v2_xxx::bad_result_access" "bad_result_access" >}}. +- No-value `.value()` observation throws {{< api "bad_access/#standardese-outcome_v2_xxx__bad_result_access_with-S-" "bad_result_access_with" >}}. +- No-error `.error()` observation throws {{< api "bad_access/#standardese-outcome_v2_xxx__bad_result_access" "bad_result_access" >}}. If you need run time unchecked observers, `.assume_value()` and `.assume_error()` are always unchecked at run time. diff --git a/doc/src/content/tutorial/hooks/_index.md b/doc/src/content/tutorial/hooks/_index.md index 8c62c966dd0..6e7f7fa64de 100644 --- a/doc/src/content/tutorial/hooks/_index.md +++ b/doc/src/content/tutorial/hooks/_index.md @@ -13,17 +13,17 @@ The final option, which this section covers, is to use the ADL discovered event which tell you when a namespace-localised `outcome` or `result` has been: - Constructed - - {{< api "result/#standardese-outcome_v2_xxx::hooks::hook_result_construction%3CT,U%3E(T*,U&&)" "hook_result_construction(result *this, U &&src)" >}} - - {{< api "outcome/#standardese-outcome_v2_xxx::hooks::hook_outcome_construction%3CT,U%3E(T*,U&&)" "hook_outcome_construction(outcome *this, U &&src)" >}} + - {{< api "result/#standardese-outcome_v2_xxx__hooks__hook_result_construction-T-U--T--U---" "hook_result_construction(result *this, U &&src)" >}} + - {{< api "outcome/#standardese-outcome_v2_xxx__hooks__hook_outcome_construction-T-U--T--U---" "hook_outcome_construction(outcome *this, U &&src)" >}} - In-place constructed - - {{< api "result/#standardese-outcome_v2_xxx::hooks::hook_result_in_place_construction%3CT,U,Args%3E(T*,in_place_type_t%3CU%3E,Args&&...)" "hook_result_in_place_construction(result *this, in_place_type_t, Args&&... srcs)" >}} - - {{< api "outcome/#standardese-outcome_v2_xxx::hooks::hook_outcome_in_place_construction%3CT,U,Args%3E(T*,in_place_type_t%3CU%3E,Args&&...)" "hook_outcome_in_place_construction(outcome *this, in_place_type_t, Args&&... srcs)" >}} + - {{< api "result/#standardese-outcome_v2_xxx__hooks__hook_result_in_place_construction-T-U-Args--T--in_place_type_t-U--Args------" "hook_result_in_place_construction(result *this, in_place_type_t, Args&&... srcs)" >}} + - {{< api "outcome/#standardese-outcome_v2_xxx__hooks__hook_outcome_in_place_construction-T-U-Args--T--in_place_type_t-U--Args------" "hook_outcome_in_place_construction(outcome *this, in_place_type_t, Args&&... srcs)" >}} - Copied - - {{< api "result/#standardese-outcome_v2_xxx::hooks::hook_result_copy_construction%3CT,U%3E(T*,U&&)" "hook_result_copy_construction(result *this, U &&src)" >}} - - {{< api "outcome/#standardese-outcome_v2_xxx::hooks::hook_outcome_copy_construction%3CT,U%3E(T*,U&&)" "hook_outcome_copy_construction(outcome *this, U &&src)" >}} + - {{< api "result/#standardese-outcome_v2_xxx__hooks__hook_result_copy_construction-T-U--T--U---" "hook_result_copy_construction(result *this, U &&src)" >}} + - {{< api "outcome/#standardese-outcome_v2_xxx__hooks__hook_outcome_copy_construction-T-U--T--U---" "hook_outcome_copy_construction(outcome *this, U &&src)" >}} - Moved - - {{< api "result/#standardese-outcome_v2_xxx::hooks::hook_result_move_construction%3CT,U%3E(T*,U&&)" "hook_result_move_construction(result *this, U &&src)" >}} - - {{< api "outcome/#standardese-outcome_v2_xxx::hooks::hook_outcome_move_construction%3CT,U%3E(T*,U&&)" "hook_outcome_move_construction(outcome *this, U &&src)" >}} + - {{< api "result/#standardese-outcome_v2_xxx__hooks__hook_result_move_construction-T-U--T--U---" "hook_result_move_construction(result *this, U &&src)" >}} + - {{< api "outcome/#standardese-outcome_v2_xxx__hooks__hook_outcome_move_construction-T-U--T--U---" "hook_outcome_move_construction(outcome *this, U &&src)" >}} One criticism often levelled against these success-or-failure objects is that they do not provide as rich a set of facilities as C++ exception throws. This section shows diff --git a/doc/src/content/tutorial/hooks/adl_bridging.md b/doc/src/content/tutorial/hooks/adl_bridging.md index aeda056c307..5369737d3d9 100644 --- a/doc/src/content/tutorial/hooks/adl_bridging.md +++ b/doc/src/content/tutorial/hooks/adl_bridging.md @@ -6,7 +6,7 @@ tags = [ "adl-bridging"] +++ In a previous section, we used the `failure_info` type to create -the ADL bridge into the namespace where the ADL discovered {{< api "success_failure/#standardese-outcome_v2_xxx::policy::throw_as_system_error_with_payload%3CError%3E(Errorconst&)" "throw_as_system_error_with_payload()" >}} +the ADL bridge into the namespace where the ADL discovered {{< api "success_failure/#standardese-outcome_v2_xxx__policy__throw_as_system_error_with_payload-Error--Errorconst--" "throw_as_system_error_with_payload()" >}} function was to be found. Here we do the same, but more directly by creating a thin clone of `std::error_code` diff --git a/doc/src/content/tutorial/hooks/hook_result.md b/doc/src/content/tutorial/hooks/hook_result.md index ac71d52819d..ced9ce23929 100644 --- a/doc/src/content/tutorial/hooks/hook_result.md +++ b/doc/src/content/tutorial/hooks/hook_result.md @@ -10,9 +10,9 @@ slot in TLS storage and writes the current stack backtrace into it. {{% snippet "error_code_extended.cpp" "error_code_extended3" %}} -The only non-obvious part above is the call to {{< api "result/#standardese-outcome_v2_xxx::hooks::set_spare_storage%3CR,S,NoValuePolicy%3E(result_or_outcome%3CR,S,NoValuePolicy%3E*,uint16_t)" "hooks::set_spare_storage()" >}}. +The only non-obvious part above is the call to {{< api "result/#standardese-outcome_v2_xxx__hooks__set_spare_storage-R-S-NoValuePolicy--result_or_outcome-R-S-NoValuePolicy---uint16_t-" "hooks::set_spare_storage()" >}}. Both `result` and `outcome` keep their internal state metadata in a `uint32_t`, half of which is not used by Outcome. As it can be very useful to keep a small unique number attached to any particular `result` or `outcome` instance, we permit user code to set those sixteen bits to anything they feel like. -The corresponding function to retrieve those sixteen bits is {{< api "result/#standardese-outcome_v2_xxx::hooks::spare_storage%3CR,S,NoValuePolicy%3E(result_or_outcome%3CR,S,NoValuePolicy%3Econst*)" "hooks::spare_storage()" >}}. \ No newline at end of file +The corresponding function to retrieve those sixteen bits is {{< api "result/#standardese-outcome_v2_xxx__hooks__spare_storage-R-S-NoValuePolicy--result_or_outcome-R-S-NoValuePolicy-const--" "hooks::spare_storage()" >}}. \ No newline at end of file diff --git a/doc/src/content/tutorial/interop/app-map-httplib2.md b/doc/src/content/tutorial/interop/app-map-httplib2.md index 04bce38b832..7f9fe4e0529 100644 --- a/doc/src/content/tutorial/interop/app-map-httplib2.md +++ b/doc/src/content/tutorial/interop/app-map-httplib2.md @@ -3,7 +3,7 @@ title = "Mapping the HTTP library into the Application 2/2" weight = 35 +++ -If you remember the tutorial section on the [`ValueOrError` Concept](../../value-or-error), +If you remember the tutorial section on the [`ValueOrError` Concept](../value-or-error), this is an example of how to implement a custom `ValueOrError` Concept converter in Outcome: diff --git a/doc/src/content/tutorial/interop/value-or-error.md b/doc/src/content/tutorial/interop/value-or-error.md index 5b7bd919fd2..a174ab66d7b 100644 --- a/doc/src/content/tutorial/interop/value-or-error.md +++ b/doc/src/content/tutorial/interop/value-or-error.md @@ -7,9 +7,9 @@ tags = [ "value-or-error" ] Something not really mentioned until now is how Outcome interoperates with the proposed [`std::expected`](https://wg21.link/P0323), whose design lands in between `outcome::unchecked` and `outcome::checked`, both of which are simplified aliases for `outcome::result` [hard -coding the `NoValuePolicy` to a fixed policy](../policies). +coding the `NoValuePolicy` to a fixed policy](../../policies). -Expected and Outcome are [isomorphic to one another in design intent](../../faq/#why-doesn-t-outcome-duplicate-std-expected-t-e-s-design), but interoperation +Expected and Outcome are [isomorphic to one another in design intent](../../../faq/#why-doesn-t-outcome-duplicate-std-expected-t-e-s-design), but interoperation for code using Expected and Outcome ought to be seamless thanks to the proposed [`ValueOrError` concept framework](https://wg21.link/P0786), a subset of which Outcome implements. diff --git a/doc/src/content/tutorial/outcome/_index.md b/doc/src/content/tutorial/outcome/_index.md index 1e4c80e9f5c..1998bf8b2e3 100644 --- a/doc/src/content/tutorial/outcome/_index.md +++ b/doc/src/content/tutorial/outcome/_index.md @@ -7,9 +7,9 @@ tags = ["outcome"] ## `outcome<>` -Type {{< api "outcome/#standardese-outcome_v2_xxx::outcome%3CR,S,P,NoValuePolicy%3E" "outcome" >}} represets either a successfully computed value of type `T` or a reason for failure. Failure can be represented by `EC` or `EP` or both. Although usually it will either be an `EC` or an `EP`. `EC` defaults to `std::error_code` and `EP` defaults to `std::exception_ptr`. The distinction is made into two types, `EC` and `EP`: +Type {{< api "outcome/#standardese-outcome_v2_xxx__outcome-R-S-P-NoValuePolicy-" "outcome" >}} represets either a successfully computed value of type `T` or a reason for failure. Failure can be represented by `EC` or `EP` or both. Although usually it will either be an `EC` or an `EP`. `EC` defaults to `std::error_code` and `EP` defaults to `std::exception_ptr`. The distinction is made into two types, `EC` and `EP`: -- `EC` represents a failue from lower-layer function which was retured through {{< api "result/#standardese-outcome_v2_xxx::result%3CR,S,NoValuePolicy%3E" "result" >}}. +- `EC` represents a failue from lower-layer function which was retured through {{< api "result/#standardese-outcome_v2_xxx__result-R-S-NoValuePolicy-" "result" >}}. - `EP` represents pointer to an exception thrown in a lower-layer function to signal a failure; but at the current level we do not want to proceed with stack unwinding. diff --git a/doc/src/content/tutorial/payload/_index.md b/doc/src/content/tutorial/payload/_index.md index 1a99b9a6682..77f8a9e9dc1 100644 --- a/doc/src/content/tutorial/payload/_index.md +++ b/doc/src/content/tutorial/payload/_index.md @@ -7,7 +7,7 @@ tags = [ "payload", "has_error_code", "make_error_code" ] So far, type `EC` in `result` has always been a `std::error_code`. But it need in fact to merely satisfy -{{< api "success_failure/#standardese-outcome_v2_xxx::trait::has_error_code%3CT%3E" "trait::has_error_code_v">}} +{{< api "success_failure/#standardese-outcome_v2_xxx__trait__has_error_code-T-" "trait::has_error_code_v">}} for `EC` to be treated as a `std::error_code`. In turn, `trait::has_error_code_v` is true if there exists some ADL discovered free diff --git a/doc/src/content/tutorial/payload/copy_file3.md b/doc/src/content/tutorial/payload/copy_file3.md index 03088d67c58..f37c2064691 100644 --- a/doc/src/content/tutorial/payload/copy_file3.md +++ b/doc/src/content/tutorial/payload/copy_file3.md @@ -6,7 +6,7 @@ tags = ["default-actions", "value"] +++ Something not mentioned at all until now (and properly described in the next -section, [Default actions](../default-actions/)) is that Outcome can be +section, [Default actions](../../default-actions/)) is that Outcome can be programmed take various actions when the user tries to observe `.value()` when there is no value, and so on for the other possible state observations. diff --git a/doc/src/content/tutorial/result/_index.md b/doc/src/content/tutorial/result/_index.md index c8df1aa3443..cf031893cfe 100644 --- a/doc/src/content/tutorial/result/_index.md +++ b/doc/src/content/tutorial/result/_index.md @@ -23,7 +23,7 @@ if it does we want to communicate the failure reason. {{% snippet "using_result.cpp" "convert_decl" %}} -Class template {{< api "result/#standardese-outcome_v2_xxx::result%3CR,S,NoValuePolicy%3E" "result" >}} has two template parameters. The first (`T`) represents the type of the object +Class template {{< api "result/#standardese-outcome_v2_xxx__result-R-S-NoValuePolicy-" "result" >}} has two template parameters. The first (`T`) represents the type of the object returned from the function upon success; the second (`EC`) is the type of object containing information about the reason for failure when the function fails. A `result` object either stores a `T` or an `EC` at any given moment, and is therefore conceptually similar to `variant`. `EC` is defaulted to `std::error_code`. diff --git a/include/outcome/revision.hpp b/include/outcome/revision.hpp index 037bef81ed8..c27b77fac6c 100644 --- a/include/outcome/revision.hpp +++ b/include/outcome/revision.hpp @@ -1,4 +1,4 @@ // Note the second line of this file must ALWAYS be the git SHA, third line ALWAYS the git SHA update time -#define OUTCOME_PREVIOUS_COMMIT_REF f169631604d4696c02242d482ad9ae1b5a918ef2 -#define OUTCOME_PREVIOUS_COMMIT_DATE "2018-01-17 15:13:11 +00:00" -#define OUTCOME_PREVIOUS_COMMIT_UNIQUE f1696316 +#define OUTCOME_PREVIOUS_COMMIT_REF d52d32c4df8f1677fc17f35e65064708a2d477ae +#define OUTCOME_PREVIOUS_COMMIT_DATE "2018-01-17 21:03:48 +00:00" +#define OUTCOME_PREVIOUS_COMMIT_UNIQUE d52d32c4 diff --git a/make_reference_docs.py b/make_reference_docs.py index b4a2cee3d6c..71146cec9af 100644 --- a/make_reference_docs.py +++ b/make_reference_docs.py @@ -56,7 +56,8 @@ def section(item): return items[item][2] aref_re = re.compile(r'''(.*?)''') -def strip_arefs(content): +aref2_re = re.compile(r'''\[(.*)]\((.*)\)''') +def strip_arefs(content, item): idx = 0 while True: match = aref_re.search(content, idx) @@ -66,9 +67,27 @@ def strip_arefs(content): if link[0] != '#': if '#' in link: link = link[:link.find('#')] - if link not in items: + if link not in items or items[link] is None: print("Removing due to not existing", match.group(0)) content = content[:match.start(0)] + content[match.start(2):match.end(2)] + content[match.end(0):] + else: + if items[item][2] != '' and items[link][2] == '': + content = content[:match.start(1)] + '../../' + content[match.start(1):] + else: + content = content[:match.start(1)] + '../' + content[match.start(1):] + idx = match.start(0) + 1 + idx = 0 + while True: + match = aref2_re.search(content, idx) + if not match: + break + link = match.group(2) + if link[0] != '#': + if '#' in link: + link = link[:link.find('#')] + if link not in items or items[link] is None: + print("Removing due to not existing", match.group(0)) + content = content[:match.start(0)] + content[match.start(1):match.end(1)] + content[match.end(0):] idx = match.start(0) + 1 return content @@ -168,7 +187,7 @@ def ext_candidates(fpath): contents = contents.replace(item, '') contents = strip_indent_before_spans(contents) contents = repair_verbatims(contents) - contents = strip_arefs(contents) + contents = strip_arefs(contents, item) for replacement in replacements: s = section(item) r = replacements[replacement] @@ -186,7 +205,7 @@ def ext_candidates(fpath): +++ ''') contents = ih.read() - contents = strip_arefs(contents) + contents = strip_arefs(contents, item) for replacement in replacements: r = replacements[replacement] contents = contents.replace(replacement, r)