X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FMathAtom.h;h=aa6e317f899b0196891e65f7f4dd42f1cb7014a1;hb=ffff88e7fcd46afaa3b1823e9fcdc4aad4e2114b;hp=b11d75da182b3da122fae03dfbee869d0411773f;hpb=07924ac300f68eaf4825951af6a6ac3c14d6edd6;p=features.git diff --git a/src/mathed/MathAtom.h b/src/mathed/MathAtom.h index b11d75da18..aa6e317f89 100644 --- a/src/mathed/MathAtom.h +++ b/src/mathed/MathAtom.h @@ -40,33 +40,29 @@ Andre' */ +#include "support/unique_ptr.h" + namespace lyx { -class Inset; class InsetMath; class MathAtom { public: - /// default constructor, object is useless, but we need it to put it into - /// std::containers - MathAtom(); + MathAtom() = default; + MathAtom(MathAtom &&) = default; + MathAtom & operator=(MathAtom &&) = default; /// the "real constructor" explicit MathAtom(InsetMath * p); - /// copy constructor, invokes nucleus_->clone() + /// copy constructor, invokes clone() MathAtom(MathAtom const &); - /// we really need to clean up - ~MathAtom(); - /// assignment invokes nucleus_->clone() MathAtom & operator=(MathAtom const &); - /// access to the inset (checked with gprof) - InsetMath * nucleus() { return nucleus_; } - InsetMath const * nucleus() const { return nucleus_; } /// access to the inset - InsetMath const * operator->() const { return nucleus_; } - + InsetMath * nucleus() { return nucleus_.get(); } + InsetMath const * nucleus() const { return nucleus_.get(); } + InsetMath * operator->() { return nucleus_.get(); } + InsetMath const * operator->() const { return nucleus_.get(); } private: - /// - InsetMath * nucleus_; + std::unique_ptr nucleus_; };