From 1ed8f877ea0ca066c276d5bea08f2e775559aa81 Mon Sep 17 00:00:00 2001 From: Christian Bauer Date: Thu, 31 Jul 2003 00:10:46 +0000 Subject: [PATCH] DEFAULT_PRINT macros generate new-style print methods --- ginac/utils.h | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/ginac/utils.h b/ginac/utils.h index 0af6707a..e654bf88 100644 --- a/ginac/utils.h +++ b/ginac/utils.h @@ -462,23 +462,16 @@ int classname::compare_same_type(const basic & other) const \ } #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(c)) \ - inherited::print(c, level); \ - else \ - c.s << text; \ + c.s << text; \ } #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(c)) \ - inherited::print(c, level); \ - else if (is_a(c)) \ - c.s << latex; \ - else \ - c.s << text; \ + c.s << latex; \ } } // namespace GiNaC -- 2.44.0