]> www.ginac.de Git - ginac.git/blobdiff - ginac/add.cpp
Fix the compliation error *for real* ... and restore performance
[ginac.git] / ginac / add.cpp
index 2fa73dc27d168068294b07bc19979f98454dcbda..4c857044d5df509892cce89bfbafe8bd99b45c79 100644 (file)
@@ -3,7 +3,7 @@
  *  Implementation of GiNaC's sums of expressions. */
 
 /*
- *  GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2009 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <iostream>
-#include <stdexcept>
-#include <limits>
-#include <string>
-
 #include "add.h"
 #include "mul.h"
 #include "archive.h"
 #include "clifford.h"
 #include "ncmul.h"
 
+#include <iostream>
+#include <limits>
+#include <stdexcept>
+#include <string>
+
 namespace GiNaC {
 
 GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(add, expairseq,
@@ -49,7 +49,6 @@ GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(add, expairseq,
 
 add::add()
 {
-       tinfo_key = &add::tinfo_static;
 }
 
 //////////
@@ -60,7 +59,6 @@ add::add()
 
 add::add(const ex & lh, const ex & rh)
 {
-       tinfo_key = &add::tinfo_static;
        overall_coeff = _ex0;
        construct_from_2_ex(lh,rh);
        GINAC_ASSERT(is_canonical());
@@ -68,7 +66,6 @@ add::add(const ex & lh, const ex & rh)
 
 add::add(const exvector & v)
 {
-       tinfo_key = &add::tinfo_static;
        overall_coeff = _ex0;
        construct_from_exvector(v);
        GINAC_ASSERT(is_canonical());
@@ -76,7 +73,6 @@ add::add(const exvector & v)
 
 add::add(const epvector & v)
 {
-       tinfo_key = &add::tinfo_static;
        overall_coeff = _ex0;
        construct_from_epvector(v);
        GINAC_ASSERT(is_canonical());
@@ -84,7 +80,6 @@ add::add(const epvector & v)
 
 add::add(const epvector & v, const ex & oc)
 {
-       tinfo_key = &add::tinfo_static;
        overall_coeff = oc;
        construct_from_epvector(v);
        GINAC_ASSERT(is_canonical());
@@ -92,7 +87,6 @@ add::add(const epvector & v, const ex & oc)
 
 add::add(std::auto_ptr<epvector> vp, const ex & oc)
 {
-       tinfo_key = &add::tinfo_static;
        GINAC_ASSERT(vp.get()!=0);
        overall_coeff = oc;
        construct_from_epvector(*vp);
@@ -103,7 +97,7 @@ add::add(std::auto_ptr<epvector> vp, const ex & oc)
 // archiving
 //////////
 
-DEFAULT_ARCHIVING(add)
+GINAC_BIND_UNARCHIVER(add);
 
 //////////
 // functions overriding virtual functions from base classes
@@ -498,10 +492,10 @@ unsigned add::return_type() const
                return seq.begin()->rest.return_type();
 }
 
-tinfo_t add::return_type_tinfo() const
+return_type_t add::return_type_tinfo() const
 {
        if (seq.empty())
-               return this;
+               return make_return_type_t<add>();
        else
                return seq.begin()->rest.return_type_tinfo();
 }