]> www.ginac.de Git - ginac.git/commitdiff
removed redundant destructors, copy constructors, and assignment operators
authorChristian Bauer <Christian.Bauer@uni-mainz.de>
Mon, 2 Jun 2003 20:18:23 +0000 (20:18 +0000)
committerChristian Bauer <Christian.Bauer@uni-mainz.de>
Mon, 2 Jun 2003 20:18:23 +0000 (20:18 +0000)
ginac/archive.cpp
ginac/archive.h
ginac/expair.h
ginac/indexed.cpp
ginac/indexed.h

index 69a73441bc2776a62e71c9329d6f9e514339d3b4..16e3946fb7fdb8e900d15bf7875b19b9bec29c43 100644 (file)
@@ -320,18 +320,11 @@ const std::string &archive::unatomize(archive_atom id) const
 }
 
 
-/** Copy constructor of archive_node. */
-archive_node::archive_node(const archive_node &other)
-  : a(other.a), props(other.props), has_expression(other.has_expression), e(other.e)
-{
-}
-
-
 /** Assignment operator of archive_node. */
 const archive_node &archive_node::operator=(const archive_node &other)
 {
        if (this != &other) {
-               a = other.a;
+               // archive &a member doesn't get copied
                props = other.props;
                has_expression = other.has_expression;
                e = other.e;
@@ -516,29 +509,6 @@ ex archive_node::unarchive(lst &sym_lst) const
 }
 
 
-/** Assignment operator of property_info. */
-const archive_node::property_info &archive_node::property_info::operator=(const property_info &other)
-{
-       if (this != &other) {
-               type = other.type;
-               name = other.name;
-               count = other.count;
-       }
-       return *this;
-}
-
-/** Assignment operator of property. */
-const archive_node::property &archive_node::property::operator=(const property &other)
-{
-       if (this != &other) {
-               type = other.type;
-               name = other.name;
-               value = other.value;
-       }
-       return *this;
-}
-
-
 void archive::clear(void)
 {
        atoms.clear();
index 8b7ae4f3943ff5470da35056a0e09598f85c4e24..1bfa2a2ca2df0c3c8ea1ecc08ed884de89ad68c6 100644 (file)
@@ -65,10 +65,6 @@ public:
        struct property_info {
                property_info() {}
                property_info(property_type t, const std::string &n, unsigned c = 1) : type(t), name(n), count(c) {}
-               ~property_info() {}
-
-               property_info(const property_info &other) : type(other.type), name(other.name), count(other.count) {}
-               const property_info &operator=(const property_info &other);
 
                property_type type;     /**< Data type of property. */
                std::string name;   /**< Name of property. */
@@ -79,9 +75,7 @@ public:
        archive_node() : a(*dummy_ar_creator()), has_expression(false) {} // hack for cint which always requires a default constructor
        archive_node(archive &ar) : a(ar), has_expression(false) {}
        archive_node(archive &ar, const ex &expr);
-       ~archive_node() {}
 
-       archive_node(const archive_node &other);
        const archive_node &operator=(const archive_node &other);
 
        /** Add property of type "bool" to node. */
@@ -132,10 +126,6 @@ private:
        struct property {
                property() {}
                property(archive_atom n, property_type t, unsigned v) : type(t), name(n), value(v) {}
-               ~property() {}
-
-               property(const property &other) : type(other.type), name(other.name), value(other.value) {}
-               const property &operator=(const property &other);
 
                property_type type; /**< Data type of property. */
                archive_atom name;  /**< Name of property. */
index a170ae8649ba994b621ebc6ef15d51bde99c528f..40810bb9eaf318da390eb09fc08d6e6ec8548190 100644 (file)
@@ -38,20 +38,7 @@ class expair
 {
 public:
        expair() : rest(0), coeff(1) { }
-       ~expair() { }
-       expair(const expair & other) : rest(other.rest), coeff(other.coeff)
-       {
-               GINAC_ASSERT(is_exactly_a<numeric>(coeff));
-       }
-       const expair & operator=(const expair & other)
-       {
-               if (this != &other) {
-                       rest = other.rest;
-                       coeff = other.coeff;
-               }
-               return *this;
-       }
-       
+
        /** Construct an expair from two ex. */
        expair(const ex & r, const ex & c) : rest(r), coeff(c)
        {
index 6914752c72c9318615c9d8f91e545a62a37eba40..6eb14264030bb1048f9ec02fb2c8cb8d509161e2 100644 (file)
@@ -1203,16 +1203,6 @@ void spmapkey::debugprint(void) const
        std::cerr << "(" << v1 << "," << v2 << "," << dim << ")";
 }
 
-scalar_products::scalar_products(const scalar_products & other) : spm(other.spm) {}
-
-const scalar_products & scalar_products::operator=(const scalar_products & other)
-{
-       if (this != &other) {
-               spm = other.spm;
-       }
-       return *this;
-}
-
 void scalar_products::add(const ex & v1, const ex & v2, const ex & sp)
 {
        spm[spmapkey(v1, v2)] = sp;
index 2df16cc70250253e8ea39db175bdec1bb95dac0c..baf6acacc1ecc7d9d67d1c676089d70bb0c03bf5 100644 (file)
@@ -197,7 +197,6 @@ class spmapkey {
 public:
        spmapkey() : dim(wild()) {}
        spmapkey(const ex & v1, const ex & v2, const ex & dim = wild());
-       ~spmapkey() {}
 
        bool operator==(const spmapkey &other) const;
        bool operator<(const spmapkey &other) const;
@@ -216,11 +215,6 @@ typedef std::map<spmapkey, ex> spmap;
  *  @see simplify_indexed */
 class scalar_products {
 public:
-       scalar_products() {}
-       ~scalar_products() {}
-       scalar_products(const scalar_products & other);
-       const scalar_products & operator=(const scalar_products & other);
-
        /** Register scalar product pair and its value. */
        void add(const ex & v1, const ex & v2, const ex & sp);