]> www.ginac.de Git - ginac.git/commitdiff
DEFAULT_PRINT macros generate new-style print methods
authorChristian Bauer <Christian.Bauer@uni-mainz.de>
Thu, 31 Jul 2003 00:10:46 +0000 (00:10 +0000)
committerChristian Bauer <Christian.Bauer@uni-mainz.de>
Thu, 31 Jul 2003 00:10:46 +0000 (00:10 +0000)
ginac/utils.h

index 0af6707afbb85c4a911d7404c58a0f4426e23dc4..e654bf885472028f58682aef9c0c55c1933cbca8 100644 (file)
@@ -462,23 +462,16 @@ int classname::compare_same_type(const basic & other) const \
 }
 
 #define DEFAULT_PRINT(classname, text) \
 }
 
 #define DEFAULT_PRINT(classname, text) \
-void classname::print(const print_context & c, unsigned level) const \
+void classname::do_print(const print_context & c, unsigned level) const \
 { \
 { \
-       if (is_a<print_tree>(c)) \
-               inherited::print(c, level); \
-       else \
-               c.s << text; \
+       c.s << text; \
 }
 
 #define DEFAULT_PRINT_LATEX(classname, text, latex) \
 }
 
 #define DEFAULT_PRINT_LATEX(classname, text, latex) \
-void classname::print(const print_context & c, unsigned level) const \
+DEFAULT_PRINT(classname, text) \
+void classname::do_print_latex(const print_latex & c, unsigned level) const \
 { \
 { \
-       if (is_a<print_tree>(c)) \
-               inherited::print(c, level); \
-       else if (is_a<print_latex>(c)) \
-               c.s << latex; \
-       else \
-               c.s << text; \
+       c.s << latex; \
 }
 
 } // namespace GiNaC
 }
 
 } // namespace GiNaC