File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -79,17 +79,17 @@ class Result {
7979 requires Sentinel<T> && (std::constructible_from<U, Errs> || ...)
8080 && (!std::convertible_to<U, T>)
8181 constexpr Result (U&& error)
82- : value (sentinel_v<T> ),
83- error (std::forward<U>(error) ) {}
82+ : error (std::forward<U>(error) ),
83+ value (sentinel_v<T> ) {}
8484
8585 // Construct a Result with an error, initializing the normal value to its sentinel value.
8686 // Constraint: type T has a sentinel value
8787 // Constraint: some type in Errs can be constructed from type U
8888 template <typename U>
8989 requires Sentinel<U> && (std::constructible_from<U, Errs> || ...)
9090 explicit constexpr Result<U>(U&& error)
91- : value (sentinel_v<T> ),
92- error (std::forward<U>(error) ) {}
91+ : error (std::forward<U>(error) ),
92+ value (sentinel_v<T> ) {}
9393
9494 // Get the given error type, if it exists
9595 // Constraint: some type Errs can be constructed from type U
Original file line number Diff line number Diff line change @@ -17,7 +17,5 @@ void initialize() {
1717 static_assert (a.get () == a.get <int >());
1818 constexpr zest::Result<int , MyError2> b (2 );
1919 static_assert (a == b);
20-
21- zest::Result<int , IntError> c (2 );
22- zest::Result<int , IntError> d (IntError (2 ));
20+ auto c = a.get <MyError>();
2321}
You can’t perform that action at this time.
0 commit comments