summaryrefslogtreecommitdiff
path: root/starts/meaning-vm/level-0/ref.hpp
blob: 951676b1066a791c83b72a140c287ba036787f2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once

#include "common.hpp"

#include <string>

namespace intellect {
namespace level0 {

struct ref
{
	ref(concept *p);
	operator concept*() const { return ptr; }
	concept* operator->() const { return ptr; }
	bool operator==(ref const & other) const { return self.ptr == other.ptr; }
	bool operator!=(ref const & other) const { return self.ptr != other.ptr; }
	bool operator<(ref const & other) const { return self.ptr < other.ptr; }
	concept & deref() { return *ptr; }

	std::string dump(ref skipmarkertype, ref skipmarkertarget) const;

	concept * const ptr;
};

}
}