xo-alloc xo-object: + Object.self_tp

This commit is contained in:
Roland Conybeare 2025-08-06 14:11:28 -05:00
commit 150bfa4aa2
11 changed files with 76 additions and 14 deletions

View file

@ -4,9 +4,13 @@
*/
#include "Integer.hpp"
#include "xo/reflect/Reflect.hpp"
#include <cstddef>
namespace xo {
using xo::reflect::Reflect;
using xo::reflect::TaggedPtr;
namespace obj {
Integer::Integer(int_type x) : value_{x} {}
@ -20,6 +24,11 @@ namespace xo {
return dynamic_cast<Integer*>(x.ptr());
}
TaggedPtr
Integer::self_tp() const {
return Reflect::make_tp(const_cast<Integer*>(this));
}
std::size_t
Integer::_shallow_size() const {
return sizeof(Integer);