mirror of
https://github.com/geode-sdk/geode.git
synced 2025-04-01 07:40:18 -04:00
minifunction dont assume return value is default-constructible
This commit is contained in:
parent
d107f3386f
commit
243c11cc8f
1 changed files with 4 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
|||
#include <Geode/DefaultInclude.hpp>
|
||||
#include <memory>
|
||||
#include <concepts>
|
||||
#include "terminate.hpp"
|
||||
|
||||
namespace geode::utils {
|
||||
|
||||
|
@ -124,7 +125,9 @@ namespace geode::utils {
|
|||
}
|
||||
|
||||
Ret operator()(Args... args) const {
|
||||
if (!m_state) return Ret();
|
||||
if (!m_state) {
|
||||
utils::terminate("Attempted to call a MiniFunction that has already been moved");
|
||||
}
|
||||
return m_state->call(args...);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue