fix(util/optional): move constructor

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2013-11-24 00:22:02 -08:00
parent 40a2f0a588
commit 4e24dfd5a6

View file

@ -29,7 +29,7 @@ public:
}
optional(optional && other):m_some(other.m_some) {
if (m_some)
m_value = std::move(other.m_value);
new (&m_value) T(std::forward<T>(other.m_value));
}
template<typename... Args>
optional(Args&&... args):m_some(true) {