]> www.ginac.de Git - ginac.git/blobdiff - ginac/ncmul.h
* Supplement some (now deprecated) macros by inlined template functions:
[ginac.git] / ginac / ncmul.h
index 86204484c099fd9e9f37fdc9b8cff3cc95928aa8..361deff62434470a8368ad708fd6f822d2130d2c 100644 (file)
@@ -88,11 +88,20 @@ ex nonsimplified_ncmul(const exvector & v);
 ex simplified_ncmul(const exvector & v);
 
 // utility functions
+
+/** Return the ncmul object handled by an ex.
+ *  This is unsafe: you need to check the type first. */
 inline const ncmul &ex_to_ncmul(const ex &e)
 {
        return static_cast <const ncmul &>(*e.bp);
 }
 
+/** Specialization of is_exactly_a<ncmul>(obj) for ncmul objects. */
+template<> inline bool is_exactly_a<ncmul>(const basic & obj)
+{
+       return obj.tinfo()==TINFO_ncmul;
+}
+
 } // namespace GiNaC
 
 #endif // ndef __GINAC_NCMUL_H__