mirror of
https://github.com/holub/mame
synced 2025-04-10 02:28:19 +03:00
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.
This commit is contained in:
parent
5f85aff327
commit
c75845b1ef
9
3rdparty/sol2/sol/sol.hpp
vendored
9
3rdparty/sol2/sol/sol.hpp
vendored
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user