fix(util/optional): bug in emplace method

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2014-06-16 09:24:15 -07:00
parent 27130c9499
commit cb49e3719e

View file

@ -59,6 +59,7 @@ public:
void emplace(Args&&... args) {
if (m_some)
m_value.~T();
m_some = true;
new (&m_value) T(args...);
}