diff --git a/expected.hpp b/expected.hpp index ae9a0dd2..18ec55bf 100644 --- a/expected.hpp +++ b/expected.hpp @@ -11,6 +11,7 @@ #include #include + /////////////////////////////////////////////////////////////////////////////// namespace cruft { class bad_expected_access : public std::exception { @@ -45,10 +46,16 @@ namespace cruft { using error_type = ErrorT; expected () = delete; - expected (expected &&) = default; - expected& operator=(expected &&) = default; - expected (expected const&) = default; - expected& operator=(expected const&) = default; + expected (expected &&); + expected& operator=(expected &&); + expected (expected const&); + expected& operator=(expected const&); + + expected (ValueT const &_value) + { + ::new (&m_store.value) ValueT (_value); + m_valid = true; + } expected (ValueT &&_value) {