Skip to content

Commit c98b585

Browse files
Merge pull request #2 from FriedLongJohns/temp
Update sol.hpp
2 parents 466efcb + 4ccf843 commit c98b585

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/sol/sol.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6756,7 +6756,8 @@ namespace sol {
67566756
static_assert(std::is_constructible<T, Args&&...>::value, "T must be constructible with Args");
67576757

67586758
*this = nullopt;
6759-
this->construct(std::forward<Args>(args)...);
6759+
m_value = &T(std::forward<Args>(args)...);
6760+
return *m_value;
67606761
}
67616762

67626763
/// Swaps this optional with the other.

0 commit comments

Comments
 (0)