- ex_to<foo>(obj) is a good candidate for asserting is_a<foo>(obj).
authorRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Tue, 7 Aug 2001 19:04:40 +0000 (19:04 +0000)
committerRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Tue, 7 Aug 2001 19:04:40 +0000 (19:04 +0000)
ginac/basic.h

index 77134bd612ca568fffec2438e50c2163da1af8cf..b319e0d5455c12f3092438ed676b5fe0cbeb5361 100644 (file)
@@ -217,6 +217,7 @@ inline bool is_exactly_a(const ex & obj)
 template <class T>
 inline const T &ex_to(const ex &e)
 {
+       GINAC_ASSERT(is_a<T>(e));
        return static_cast<const T &>(*e.bp);
 }