Wohoo, Ref<>s are now working
This commit is contained in:
@@ -67,7 +67,7 @@ template<class T>
|
||||
struct _ArgCast {
|
||||
static T _arg_cast(Variant a)
|
||||
{
|
||||
return a.operator T();
|
||||
return static_cast<T>(a);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -108,7 +108,6 @@ public:
|
||||
|
||||
operator Variant() const
|
||||
{
|
||||
if (reference) reference->reference();
|
||||
return Variant((Object *) reference);
|
||||
}
|
||||
|
||||
@@ -130,10 +129,8 @@ public:
|
||||
|
||||
Ref(T *r)
|
||||
{
|
||||
if (r)
|
||||
ref_pointer(r);
|
||||
else
|
||||
reference = nullptr;
|
||||
r->reference();
|
||||
reference = r;
|
||||
}
|
||||
|
||||
template<class T_Other>
|
||||
@@ -153,6 +150,14 @@ public:
|
||||
ref(re);
|
||||
re.reference = nullptr;
|
||||
}
|
||||
|
||||
template<class T_Other>
|
||||
static Ref<T> __internal_constructor(T_Other *r)
|
||||
{
|
||||
Ref<T> ref;
|
||||
ref.reference = (T *) r;
|
||||
return ref;
|
||||
}
|
||||
|
||||
|
||||
inline bool is_valid() const { return reference != nullptr; }
|
||||
|
||||
Reference in New Issue
Block a user