]> www.ginac.de Git - ginac.git/blobdiff - ginac/indexed.h
#ifndef around namespace GiNaC { }
[ginac.git] / ginac / indexed.h
index 7f13af51bef0439451a090652f67f9d811f996bc..a731769bd9f5c9826ead34ae4077094f4fb71500 100644 (file)
 #include <string>
 #include <ginac/exprseq.h>
 
+#ifndef NO_GINAC_NAMESPACE
+namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
+
 /** Base class for non-commutative indexed objects */
 class indexed : public exprseq
 {
@@ -86,10 +90,14 @@ protected:
 extern const indexed some_indexed;
 extern type_info const & typeid_indexed;
 
-// macros
+// utility functions
+inline const indexed &ex_to_indexed(const ex &e)
+{
+       return static_cast<const indexed &>(*e.bp);
+}
 
-#define ex_to_indexed(X) static_cast<indexed const &>(*(X).bp)
+#ifndef NO_GINAC_NAMESPACE
+} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
 
 #endif // ndef __GINAC_INDEXED_H__
-
-