fix(util/optional): bug in emplace method
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
27130c9499
commit
cb49e3719e
1 changed files with 1 additions and 0 deletions
|
@ -59,6 +59,7 @@ public:
|
|||
void emplace(Args&&... args) {
|
||||
if (m_some)
|
||||
m_value.~T();
|
||||
m_some = true;
|
||||
new (&m_value) T(args...);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue