mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
fix a common bad usage
This commit is contained in:
parent
6bb698a020
commit
bbf7304946
@ -171,6 +171,8 @@ template <typename T> struct has_gc_marker<T, std::void_t<decltype(&T::_gc_mark)
|
|||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct Py_ final: PyObject {
|
struct Py_ final: PyObject {
|
||||||
|
static_assert(!std::is_reference_v<T>, "T must not be a reference type. Are you using `PK_OBJ_GET(T&, ...)`?");
|
||||||
|
|
||||||
T _value;
|
T _value;
|
||||||
void _obj_gc_mark() override {
|
void _obj_gc_mark() override {
|
||||||
if constexpr (has_gc_marker<T>::value) {
|
if constexpr (has_gc_marker<T>::value) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user