From: Christian Bauer Date: Mon, 2 Jun 2003 20:18:23 +0000 (+0000) Subject: removed redundant destructors, copy constructors, and assignment operators X-Git-Tag: release_1-1-1~9 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?a=commitdiff_plain;h=2f3e93191032dd54bc0e2b3f1dedcc3bafc7ab4f;p=ginac.git removed redundant destructors, copy constructors, and assignment operators --- diff --git a/ginac/archive.cpp b/ginac/archive.cpp index 69a73441..16e3946f 100644 --- a/ginac/archive.cpp +++ b/ginac/archive.cpp @@ -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(); diff --git a/ginac/archive.h b/ginac/archive.h index 8b7ae4f3..1bfa2a2c 100644 --- a/ginac/archive.h +++ b/ginac/archive.h @@ -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. */ diff --git a/ginac/expair.h b/ginac/expair.h index a170ae86..40810bb9 100644 --- a/ginac/expair.h +++ b/ginac/expair.h @@ -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(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) { diff --git a/ginac/indexed.cpp b/ginac/indexed.cpp index 6914752c..6eb14264 100644 --- a/ginac/indexed.cpp +++ b/ginac/indexed.cpp @@ -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; diff --git a/ginac/indexed.h b/ginac/indexed.h index 2df16cc7..baf6acac 100644 --- a/ginac/indexed.h +++ b/ginac/indexed.h @@ -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 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);