Files
shadow-over-bishkek001/cmake/patches/sol2-3.3.0-clang-optional.patch
T
2026-11-09 16:21:41 +06:00

16 lines
589 B
Diff

--- a/include/sol/optional_implementation.hpp
+++ b/include/sol/optional_implementation.hpp
@@ -2191,8 +2191,10 @@ namespace sol {
static_assert(std::is_constructible<T, Args&&...>::value, "T must be constructible with Args");
*this = nullopt;
- this->construct(std::forward<Args>(args)...);
- return value();
+ // Reference specialization stores a pointer; set it directly.
+ // construct() only exists in the non-reference specialization.
+ m_value = std::addressof(std::forward<Args>(args)...);
+ return *m_value;
}
/// Swaps this optional with the other.