-
-
Notifications
You must be signed in to change notification settings - Fork 421
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adding patch for sol2 3.3.0 * Disable wasm plat --------- Co-authored-by: star9029 <[email protected]>
- Loading branch information
1 parent
2317f11
commit 7038d6f
Showing
2 changed files
with
18 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
diff --git a/include/sol/optional_implementation.hpp b/include/sol/optional_implementation.hpp | ||
index 26f41d0c..e22226d6 100644 | ||
--- a/include/sol/optional_implementation.hpp | ||
+++ b/include/sol/optional_implementation.hpp | ||
@@ -2191,7 +2191,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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters