Fix AllocationFailure when multiple instances

This commit is contained in:
Léa Saviot
2018-06-28 17:59:06 +02:00
parent bd61298374
commit cb77fbe2ff
10 changed files with 133 additions and 39 deletions

View File

@@ -12,10 +12,11 @@ public:
using TreeReference<T>::TreeReference;
// Allow every ExpressionReference<T> to be transformed into an ExpressionReference<ExpressionNode>, i.e. Expression
operator ExpressionReference<ExpressionNode>() const {
operator ExpressionReference<ExpressionNode>() {
return ExpressionReference<ExpressionNode>(this->node());
}
static ExpressionReference<ExpressionNode> failedAllocationRef();
static TreeNode * failedAllocationNode();
void addChild(ExpressionReference<ExpressionNode> e) {
@@ -32,7 +33,7 @@ public:
TreeReference<T>::replaceChildAtIndex(oldChildIndex, newChild);
}
float approximate() const {
float approximate() {
return this->castedNode()->approximate();
}