Fix no member named 'construct' in 'optional<type-parameter-0-0 &>' error in sol.hpp with Clang 19 (#7098)

This commit is contained in:
Alexander Farber
2025-01-25 08:09:37 +01:00
committed by GitHub
parent 6f235cca15
commit 61464fc2bd
4 changed files with 18 additions and 14 deletions
+2 -1
View File
@@ -6752,7 +6752,8 @@ namespace sol {
static_assert(std::is_constructible<T, Args&&...>::value, "T must be constructible with Args");
*this = nullopt;
this->construct(std::forward<Args>(args)...);
new (static_cast<void*>(this)) optional(std::in_place, std::forward<Args>(args)...);
return **this;
}
/// Swaps this optional with the other.