diff --git a/include/sol/optional_implementation.hpp b/include/sol/optional_implementation.hpp index e22226d6..dd9a2dd1 100644 --- a/include/sol/optional_implementation.hpp +++ b/include/sol/optional_implementation.hpp @@ -2186,12 +2186,8 @@ namespace sol { /// one. /// /// \group emplace - template - T& emplace(Args&&... args) noexcept { - static_assert(std::is_constructible::value, "T must be constructible with Args"); - - *this = nullopt; - new (static_cast(this)) optional(std::in_place, std::forward(args)...); + T& emplace(T& arg) noexcept { + m_value = &arg; return **this; }