Fully working ADTs! Hopefully bugless

This commit is contained in:
Nathan Braswell
2015-11-25 15:35:06 -05:00
parent 624f070c74
commit e76bc51cce
7 changed files with 183 additions and 39 deletions

View File

@@ -240,6 +240,16 @@ Type Type::withIncreasedIndirection() {
newOne->increaseIndirection();
return *newOne;
}
Type Type::withReference() {
Type *newOne = clone();
newOne->is_reference = true;
return *newOne;
}
Type *Type::withReferencePtr() {
Type *newOne = clone();
newOne->is_reference = true;
return newOne;
}
Type *Type::withIncreasedIndirectionPtr() {
Type *newOne = clone();
newOne->increaseIndirection();