From 6334908e209fc0de7c2dea95ff2808c5bbd71735 Mon Sep 17 00:00:00 2001 From: Christian Bauer Date: Mon, 21 Jul 2003 17:44:38 +0000 Subject: [PATCH] more efficient default is_exactly_a<>() --- ginac/basic.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ginac/basic.h b/ginac/basic.h index 264462f9..d9b716a4 100644 --- a/ginac/basic.h +++ b/ginac/basic.h @@ -176,7 +176,7 @@ extern int max_recursion_level; template inline bool is_a(const basic &obj) { - return dynamic_cast(&obj)!=0; + return dynamic_cast(&obj) != 0; } /** Check if obj is a T, not including base classes. This one is just an @@ -185,7 +185,7 @@ inline bool is_a(const basic &obj) template inline bool is_exactly_a(const class basic &obj) { - const T foo; return foo.tinfo()==obj.tinfo(); + return obj.tinfo() == T::reg_info.tinfo_key; } } // namespace GiNaC -- 2.47.0