mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
Update obj.h
This commit is contained in:
parent
9257d18a75
commit
73fbb98712
@ -41,6 +41,9 @@ struct NativeFunc {
|
||||
T get_userdata() const {
|
||||
static_assert(std::is_trivially_copyable_v<T>);
|
||||
static_assert(sizeof(T) <= sizeof(UserData));
|
||||
#if DEBUG_EXTRA_CHECK
|
||||
if(!_has_userdata) throw std::runtime_error("userdata not set");
|
||||
#endif
|
||||
return reinterpret_cast<const T&>(_userdata);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user