public:
Handle() = default;
-
- static Handle from_object(T *o) { Handle h; h.ptr = o; return h; }
+ Handle(nullptr_t) { }
template<typename U>
requires std::is_base_of_v<T, U>
Handle(const Handle<U> &other): ptr(other.ptr) { }
+ static Handle from_object(T *o) { Handle h; h.ptr = o; return h; }
+
T *get() const { return ptr; }
T &operator*() const { return *ptr; }
T *operator->() const { return ptr; }
Stage &stage;
public:
- Root(Stage &s): Entity(Handle<Entity>()), stage(s) { }
+ Root(Stage &s): Entity(nullptr), stage(s) { }
Stage &get_stage() const { return stage; }
};