Add templated version of ObjectDB::get_instance()

This commit is contained in:
kobewi 2025-03-27 14:42:42 +01:00
parent 594d64ec24
commit bc9d0c7835
49 changed files with 121 additions and 104 deletions

View file

@ -285,3 +285,8 @@ struct VariantInternalAccessor<const Ref<T> &> {
// Zero-constructing Ref initializes reference to nullptr (and thus empty).
template <typename T>
struct is_zero_constructible<Ref<T>> : std::true_type {};
template <typename T>
Ref<T> ObjectDB::get_ref(ObjectID p_instance_id) {
return Ref<T>(get_instance(p_instance_id));
}