]> www.ginac.de Git - ginac.git/blobdiff - ginac/structure.h
A better return_type_tinfo() mechanism.
[ginac.git] / ginac / structure.h
index be43c5852e38b0314fca49aaaac0d8afa14f2786..cfd17c90cc41feed0973015a8fe4a07157f23c17 100644 (file)
@@ -3,7 +3,7 @@
  *  Wrapper template for making GiNaC classes out of C++ structures. */
 
 /*
- *  GiNaC Copyright (C) 1999-2006 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2008 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
@@ -156,7 +156,7 @@ public:
 
        // pattern matching
        bool has(const ex & other, unsigned options = 0) const { return inherited::has(other, options); }
-       bool match(const ex & pattern, lst & repl_lst) const { return inherited::match(pattern, repl_lst); }
+       bool match(const ex & pattern, exmap& repl_lst) const { return inherited::match(pattern, repl_lst); }
 protected:
        bool match_same_type(const basic & other) const { return true; }
 public:
@@ -200,7 +200,13 @@ public:
 
        // noncommutativity
        unsigned return_type() const { return return_types::commutative; }
-       tinfo_t return_type_tinfo() const { return this; }
+       return_type_t return_type_tinfo() const 
+       {
+               return_type_t r;
+               r.rl = 0;
+               r.tinfo = &typeid(*this);
+               return r;
+       }
 
 protected:
        bool is_equal_same_type(const basic & other) const