fix universal: make utils::expected description consistent#1204
fix universal: make utils::expected description consistent#1204ddvamp wants to merge 2 commits intouserver-framework:developfrom
Conversation
|
Are you interested in changes/refactoring like those in this commit (7f96faf) ? Summary of changes:
|
| template <class S, class E> | ||
| expected<S, E>::expected(const S& success) | ||
| : data_(success) | ||
| : data_(std::in_place_index<0>, success) |
There was a problem hiding this comment.
it's easy to accidentally confuse constants 1 and 2. Make those a named constants kSuccessIndex and kErrorIndex and use the readable names everywhere in this file
|
|
||
| EXPECT_FALSE(e.has_value()); | ||
| EXPECT_THROW(e.value(), utils::bad_expected_access); | ||
| EXPECT_FALSE(e.has_error()); |
There was a problem hiding this comment.
It should behave differently http://eel.is/c++draft/expected.object.assign
There was a problem hiding this comment.
Are you suggesting adding an implementation of operator= (copy/move) corresponding to std::expected::operator=?
There was a problem hiding this comment.
Yep... We are planning to remove utils::expected after a few years and replace it with std::expected
The closer the behavior of those two types - the better.
Fixes #1203