mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-22 12:30:19 +00:00
Update vm.h
This commit is contained in:
parent
93e6eb99ea
commit
a063249832
5
src/vm.h
5
src/vm.h
@ -784,10 +784,9 @@ public:
|
|||||||
PyVar _tp_user_pointer, _tp_super;
|
PyVar _tp_user_pointer, _tp_super;
|
||||||
|
|
||||||
template<typename P>
|
template<typename P>
|
||||||
inline PyVarRef PyRef(P value) {
|
inline PyVarRef PyRef(P&& value) {
|
||||||
// TODO: use perfect forwarding
|
|
||||||
static_assert(std::is_base_of<BaseRef, P>::value, "P should derive from BaseRef");
|
static_assert(std::is_base_of<BaseRef, P>::value, "P should derive from BaseRef");
|
||||||
return newObject(_tp_ref, value);
|
return newObject(_tp_ref, std::forward<P>(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const BaseRef* PyRef_AS_C(const PyVar& obj)
|
inline const BaseRef* PyRef_AS_C(const PyVar& obj)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user