1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2025-08-03 12:49:50 +00:00

fix optional converting constructor

This commit is contained in:
bolero-MURAKAMI 2012-10-27 15:53:34 +09:00
parent 5aa4cf8cbe
commit d75283355c
2 changed files with 36 additions and 1 deletions

View file

@ -58,7 +58,7 @@ namespace sprout {
template<typename U>
explicit SPROUT_CONSTEXPR optional(optional<U> const& v)
: init(v.is_initialized())
, val(v.get())
, val(v.is_initialized() ? v.get() : holder_type())
{}
optional& operator=(sprout::nullopt_t v) SPROUT_NOEXCEPT {