summaryrefslogtreecommitdiff
path: root/starts/meaning-vm/level-2-wip-stmtexprs/baseref.hpp
blob: 84c9c13bb6109f0efaf1f1db002404b3fd0510ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#pragma once

#include "common.hpp"
#include "../level-1/ref.hpp"
#include "statementref.hpp"

namespace intellect {
namespace level2 {

template <typename ref>
struct baseref : public level1::baseref<ref>
{
	using level1::baseref<ref>::baseref;
	baseref(level1::ref other) : level1::baseref<ref>(other.ptr()) { }
	operator level1::ref() { return ptr(); }

	statementref operator=(ref other) { return assignop(self, other); }
	statementref operator,(ref other) { return commaop(self, other); }
	ref operator[](ref other) { return subop(self, other); }
}

}
}