diff options
author | 2024-11-18 06:19:06 +1100 | |
---|---|---|
committer | 2024-11-18 06:19:06 +1100 | |
commit | c75845b1ef01d76379bcc0a6937f1ca678484c68 (patch) | |
tree | 752b563c6a7514faa53aa5c71dd39ef6636a30b2 /3rdparty/sol2/sol/sol.hpp | |
parent | 5f85aff327dee56dd1a31d2e824de067e4f60430 (diff) |
3rdparty/sol2: Fixed build with clang 19.
sol::optional<T&>::emplace was broken, and depended on the compiler not
checking that members exist if the template wasn't instantiated. See
ThePHD/sol2#1606 and ThePHD/sol2#1648.
Diffstat (limited to '3rdparty/sol2/sol/sol.hpp')
-rw-r--r-- | 3rdparty/sol2/sol/sol.hpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/3rdparty/sol2/sol/sol.hpp b/3rdparty/sol2/sol/sol.hpp index 1a9375d996d..04fd7e4958d 100644 --- a/3rdparty/sol2/sol/sol.hpp +++ b/3rdparty/sol2/sol/sol.hpp @@ -6747,12 +6747,9 @@ namespace sol { /// one. /// /// \group emplace - template <class... Args> - T& emplace(Args&&... args) noexcept { - static_assert(std::is_constructible<T, Args&&...>::value, "T must be constructible with Args"); - - *this = nullopt; - this->construct(std::forward<Args>(args)...); + T& emplace(T& arg) noexcept { + m_value = &arg; + return **this; } /// Swaps this optional with the other. |