Commit 2252770f authored by Dominik Charousset's avatar Dominik Charousset

Construct expected<void> from error codes

parent 4e579353
...@@ -375,6 +375,11 @@ public: ...@@ -375,6 +375,11 @@ public:
// nop // nop
} }
template <class Code, class E = enable_if_has_make_error_t<Code>>
expected(Code code) : error_(make_error(code)) {
// nop
}
expected& operator=(const expected& other) noexcept { expected& operator=(const expected& other) noexcept {
error_ = other.error_; error_ = other.error_;
return *this; return *this;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment