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,11 +4,15 @@
**/
#include "List.hpp"
#include "xo/reflect/Reflect.hpp"
#include "xo/indentlog/scope.hpp"
#include <cassert>
#include <cstddef>
namespace xo {
using xo::reflect::Reflect;
using xo::reflect::TaggedPtr;
namespace obj {
List::List(gp<Object> head, gp<List> rest)
: head_{head}, rest_{rest} {}
@ -66,6 +70,11 @@ namespace xo {
Object::assign_member(this, &(this->rest_), tail);
}
TaggedPtr
List::self_tp() const {
return Reflect::make_tp(const_cast<List*>(this));
}
std::size_t
List::_shallow_size() const {
return sizeof(List);