]> git.lyx.org Git - features.git/blobdiff - src/mathed/MathAtom.h
Rm dup "Float" in "Insert>Float>Figure Wrap Float"
[features.git] / src / mathed / MathAtom.h
index b11d75da182b3da122fae03dfbee869d0411773f..aa6e317f899b0196891e65f7f4dd42f1cb7014a1 100644 (file)
@@ -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<InsetMath> nucleus_;
 };