mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-07-25 08:58:27 -07:00
- Tests pass - Patch taken from upstream Closes: https://bugs.gentoo.org/936924 Signed-off-by: Christopher Fore <csfore@posteo.net> Closes: https://github.com/gentoo/gentoo/pull/37886 Signed-off-by: Sam James <sam@gentoo.org>
19 lines
660 B
Diff
19 lines
660 B
Diff
https://github.com/ThePhD/sol2/commit/d805d027e0a0a7222e936926139f06e23828ce9f
|
|
|
|
From: =?UTF-8?q?=E2=80=9CPaulo?= <paulo@ubook.com>
|
|
Date: Sat, 25 May 2024 01:52:59 -0300
|
|
Subject: [PATCH] fix emplace
|
|
|
|
--- 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.
|