From 520119a6f6ed418b8ae45bfde8239bbb532562cd Mon Sep 17 00:00:00 2001 From: olpc user Date: Mon, 25 Nov 2019 05:02:10 -0800 Subject: cleanup mixin pointer mess for refs --- starts/meaning-vm/level-1/ref.hpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'starts/meaning-vm/level-1/ref.hpp') diff --git a/starts/meaning-vm/level-1/ref.hpp b/starts/meaning-vm/level-1/ref.hpp index 40eee20..8a7394e 100644 --- a/starts/meaning-vm/level-1/ref.hpp +++ b/starts/meaning-vm/level-1/ref.hpp @@ -1,15 +1,17 @@ #pragma once #include "common.hpp" +#include "../level-0/baseref.hpp" #include "../level-0/ref.hpp" -#include "../level-0/ref-mixin.hpp" namespace intellect { namespace level1 { -struct ref : public level0::refmixin +struct ref : public level0::baseref { - ref(level0::ref const & other) : ref0(other) { } + using level0::baseref::baseref; + ref(level0::concept * p) : baseref(p) { } + ref(level0::ref const & other) : baseref(other.ptr()) { } ref(std::string const & name); ref(const char *name) : ref(std::string(name)) { } ref(bool b) : ref(b ? "true" : "false") { } @@ -20,14 +22,11 @@ struct ref : public level0::refmixin vref name() const; - level0::ref & l0() { return ref0; } + level0::ref & l0() { return *reinterpret_cast(this); } ref & l1() { return self; } ref const & l1() const { return self; } std::string dump(ref skipmarkertype, ref skipmarkertarget); -private: - - level0::ref ref0; }; } -- cgit v1.2.3