X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fstructure.h;h=6c08618c7c4a7752e4033b0db2dbe65213ec3456;hp=be43c5852e38b0314fca49aaaac0d8afa14f2786;hb=09988aee53a2bfef87fc887a434b4c78d6326c47;hpb=29b420743599f001b8bfc8b63fb6ac81aa3dfba7 diff --git a/ginac/structure.h b/ginac/structure.h index be43c585..6c08618c 100644 --- a/ginac/structure.h +++ b/ginac/structure.h @@ -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 @@ -119,7 +119,6 @@ class structure : public basic, public ComparisonPolicy { // helpers static tinfo_t get_tinfo() { return reg_info.options.get_id(); } static const char *get_class_name() { return "structure"; } - static tinfo_t next_structure_tinfo_key() { return new tinfo_static_t; } // constructors public: @@ -156,7 +155,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 +199,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 @@ -257,7 +262,7 @@ int structure::compare_same_type(const basic & other) const } template class CP> -registered_class_info structure::reg_info = registered_class_info(registered_class_options(structure::get_class_name(), "basic", structure::next_structure_tinfo_key(), &structure::unarchive)); +registered_class_info structure::reg_info = registered_class_info(registered_class_options(structure::get_class_name(), "basic", typeid(structure), &structure::unarchive)); } // namespace GiNaC