More work on ADTs
This commit is contained in:
@@ -199,7 +199,7 @@ std::string Type::toString(bool showTraits) {
|
||||
if (is_reference)
|
||||
typeString = "ref " + typeString;
|
||||
for (int i = 0; i < indirection; i++)
|
||||
typeString = "*" + typeString;
|
||||
typeString += "*";
|
||||
if (indirection < 0)
|
||||
typeString += "negative indirection: " + intToString(indirection);
|
||||
if (traits.size() && showTraits) {
|
||||
@@ -240,6 +240,11 @@ Type Type::withIncreasedIndirection() {
|
||||
newOne->increaseIndirection();
|
||||
return *newOne;
|
||||
}
|
||||
Type *Type::withIncreasedIndirectionPtr() {
|
||||
Type *newOne = clone();
|
||||
newOne->increaseIndirection();
|
||||
return newOne;
|
||||
}
|
||||
Type Type::withDecreasedIndirection() {
|
||||
Type *newOne = clone();
|
||||
newOne->decreaseIndirection();
|
||||
|
||||
Reference in New Issue
Block a user