Added clone method

release/4.3a0
dellaert 2014-12-29 14:10:07 +01:00
parent 478f354922
commit ab1148a508
1 changed files with 9 additions and 0 deletions

View File

@ -170,6 +170,15 @@ public:
return root_->value(values);
}
/**
* @return a "deep" copy of this Expression
* "deep" is in quotes because the ExpressionNode hierarchy is *not* cloned.
* The intent is for derived classes to be copied using only a Base pointer.
*/
virtual boost::shared_ptr<Expression> clone() const {
return boost::make_shared<Expression>(*this);
}
private:
/// Vaguely unsafe keys and dimensions in same order