From 6b151d8ad34740171ec4ba62ceaf918422aa62f4 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Fri, 5 Sep 2008 07:50:37 -0400 Subject: CarpetLib: Simplify fulltree API to avoid problems with PGI compiler --- Carpet/CarpetLib/src/fulltree.cc | 2 +- Carpet/CarpetLib/src/fulltree.hh | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'Carpet/CarpetLib') diff --git a/Carpet/CarpetLib/src/fulltree.cc b/Carpet/CarpetLib/src/fulltree.cc index 2687a5b61..0318cb83c 100644 --- a/Carpet/CarpetLib/src/fulltree.cc +++ b/Carpet/CarpetLib/src/fulltree.cc @@ -315,7 +315,7 @@ fulltree::iterator::~iterator () template fulltree & -fulltree::iterator::operator* () +fulltree::iterator::operator* () const { assert (not done()); assert (not f.empty()); diff --git a/Carpet/CarpetLib/src/fulltree.hh b/Carpet/CarpetLib/src/fulltree.hh index e0c55fbfa..d8869a919 100644 --- a/Carpet/CarpetLib/src/fulltree.hh +++ b/Carpet/CarpetLib/src/fulltree.hh @@ -127,7 +127,7 @@ public: iterator (fulltree & f_); iterator (fulltree & f_, int); ~iterator (); - fulltree & operator* (); + fulltree & operator* () const; bool operator== (iterator const & it2) const; bool operator!= (iterator const & it2) const { return not (*this == it2); } @@ -135,6 +135,12 @@ public: bool done () const; }; +#if 0 + // ES 2008-09-04: + // It seems that PGI does not handle comparisons to end() correctly. + // We therefore disable these; please use the iterators' + // constructors and their done() methods instead. + const_iterator begin() const { return const_iterator (*this); } @@ -146,6 +152,7 @@ public: iterator end() { return iterator (*this, 0); } +#endif // Memory usage size_t memory () const; -- cgit v1.2.3