]> www.ginac.de Git - ginac.git/blobdiff - ginac/add.h
#ifndef around namespace GiNaC { }
[ginac.git] / ginac / add.h
index 0545bcd2e1fd9d3710ce01e01054ee1bdadafff7..1acb03d17200b5cdeb1c8323957e3dd41312247f 100644 (file)
 
 #include <ginac/expairseq.h>
 
+#ifndef NO_GINAC_NAMESPACE
+namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
+
 /** Sum of expressions. */
 class add : public expairseq
 {
@@ -79,8 +83,6 @@ protected:
     unsigned return_type_tinfo(void) const;
     ex thisexpairseq(epvector const & v, ex const & oc) const;
     ex thisexpairseq(epvector * vp, ex const & oc) const;
-    void printpair(ostream & os, expair const & p,
-                   unsigned upper_precedence) const;
     expair split_ex_to_pair(ex const & e) const;
     expair combine_ex_with_coeff_to_pair(ex const & e,
                                          ex const & c) const;
@@ -106,6 +108,14 @@ protected:
 extern const add some_add;
 extern type_info const & typeid_add;
 
-#define ex_to_add(X) static_cast<add const &>(*(X).bp)
+// utility functions
+inline const add &ex_to_add(const ex &e)
+{
+       return static_cast<const add &>(*e.bp);
+}
+
+#ifndef NO_GINAC_NAMESPACE
+} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
 
 #endif // ndef __GINAC_ADD_H__