[poincare] Implement Symbol copy constructor

Change-Id: Ie2bef0ba70f11608fd8aebbfa545f6de2e4872bb
This commit is contained in:
Émilie Feral
2017-12-05 15:14:34 +01:00
committed by Ecco
parent 105b52cea8
commit c889bb4092
2 changed files with 6 additions and 0 deletions

View File

@@ -31,6 +31,7 @@ public:
static SpecialSymbols matrixSymbol(char index);
Symbol(char name);
Symbol(Symbol&& other); // C++11 move constructor
Symbol(const Symbol& other); // C++11 copy constructor
char name() const;
Type type() const override;
Expression * clone() const override;

View File

@@ -92,6 +92,11 @@ Symbol::Symbol(Symbol&& other) :
{
}
Symbol::Symbol(const Symbol& other) :
m_name(other.m_name)
{
}
Expression * Symbol::clone() const {
return new Symbol(m_name);
}