Skip to content

Commit

Permalink
Fix sol2 build issue in newer gcc/clang
Browse files Browse the repository at this point in the history
Fixes #1750
  • Loading branch information
sirjuddington committed Dec 22, 2024
1 parent a48dc10 commit d9fcc9d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion thirdparty/sol/sol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5968,7 +5968,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.
Expand Down

0 comments on commit d9fcc9d

Please sign in to comment.