fix(util/optional): move constructor
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
40a2f0a588
commit
4e24dfd5a6
1 changed files with 1 additions and 1 deletions
|
@ -29,7 +29,7 @@ public:
|
||||||
}
|
}
|
||||||
optional(optional && other):m_some(other.m_some) {
|
optional(optional && other):m_some(other.m_some) {
|
||||||
if (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>
|
template<typename... Args>
|
||||||
optional(Args&&... args):m_some(true) {
|
optional(Args&&... args):m_some(true) {
|
||||||
|
|
Loading…
Reference in a new issue