xo-interpreter: implement variable lookup

This commit is contained in:
Roland Conybeare 2025-11-25 12:43:57 -05:00
commit e5a72bce36

View file

@ -39,6 +39,10 @@ namespace xo {
template <typename S> template <typename S>
gc_ptr(const gc_ptr<S> & x) : ptr_{x.ptr()} {} gc_ptr(const gc_ptr<S> & x) : ptr_{x.ptr()} {}
/** runtime downcast. shorthand for dynamic_cast<T*> **/
template <typename S>
static gc_ptr<T> from(const gc_ptr<S> & x) { return gc_ptr<T>{dynamic_cast<T*>(x.ptr())}; }
/** convenience for static asserts **/ /** convenience for static asserts **/
static constexpr bool is_gc_ptr = true; static constexpr bool is_gc_ptr = true;
/** see also: xo/refcnt/Refcounted.hpp **/ /** see also: xo/refcnt/Refcounted.hpp **/