From: wolf Date: Tue, 7 Mar 2000 13:16:45 +0000 (+0000) Subject: Minor clean-ups. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45de5668b494806d2a0d8e98de989347d60b7fac;p=dealii-svn.git Minor clean-ups. git-svn-id: https://svn.dealii.org/trunk@2563 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/grid/tria_iterator.h b/deal.II/deal.II/include/grid/tria_iterator.h index d54fdd6fb2..51a5465c4d 100644 --- a/deal.II/deal.II/include/grid/tria_iterator.h +++ b/deal.II/deal.II/include/grid/tria_iterator.h @@ -454,7 +454,7 @@ class TriaRawIterator : public bidirectional_iterator { void print (ostream &out) const; -/**@name Exceptions*/ + /**@name Exceptions*/ /*@{*/ /** * Exception @@ -477,7 +477,7 @@ class TriaRawIterator : public bidirectional_iterator { Accessor accessor; -/** + /** * Make all other iterator class templates * friends of this class. This is * necessary for the implementation of @@ -817,6 +817,7 @@ TriaRawIterator::TriaRawIterator (const Accessor &a) : {}; + template template inline @@ -825,54 +826,64 @@ TriaRawIterator::TriaRawIterator (const TriaRawIterator inline const Accessor & -TriaRawIterator::operator * () const { +TriaRawIterator::operator * () const +{ Assert (state() == valid, ExcDereferenceInvalidObject()); return accessor; }; + template inline Accessor & -TriaRawIterator::operator * () { +TriaRawIterator::operator * () +{ Assert (state() == valid, ExcDereferenceInvalidObject()); return accessor; }; + template inline const Accessor * -TriaRawIterator::operator -> () const { +TriaRawIterator::operator -> () const +{ return &(this->operator* ()); }; + template inline Accessor * -TriaRawIterator::operator -> () { +TriaRawIterator::operator -> () +{ return &(this->operator* ()); }; + template inline IteratorState -TriaRawIterator::state () const { +TriaRawIterator::state () const +{ return accessor.state (); }; -// sorry that the declaration of this function looks so ragged; I had -// to do it this way since otherwise doc++ could not parse it correctly. + template inline bool -TriaRawIterator::operator < (const TriaRawIterator &i) const { +TriaRawIterator::operator < (const TriaRawIterator &i) const +{ Assert (state() != invalid, ExcDereferenceInvalidObject()); Assert (i.state() != invalid, ExcDereferenceInvalidObject()); Assert (&accessor.get_triangulation() == &i.accessor.get_triangulation(), @@ -890,7 +901,8 @@ TriaRawIterator::operator < (const TriaRawIterator &i) const { template inline TriaRawIterator & -TriaRawIterator::operator ++ () { +TriaRawIterator::operator ++ () +{ Assert (state() == valid, ExcAdvanceInvalidObject()); ++accessor; @@ -898,10 +910,12 @@ TriaRawIterator::operator ++ () { }; + template inline TriaRawIterator & -TriaRawIterator::operator -- () { +TriaRawIterator::operator -- () +{ Assert (state() == valid, ExcAdvanceInvalidObject()); --accessor; @@ -909,14 +923,17 @@ TriaRawIterator::operator -- () { }; + template inline void -TriaRawIterator::print (ostream &out) const { +TriaRawIterator::print (ostream &out) const +{ out << accessor.level() << "." << accessor.index(); }; + template template inline @@ -925,6 +942,7 @@ TriaIterator::TriaIterator (const TriaIterator {}; + template template inline @@ -945,6 +963,7 @@ TriaIterator::TriaIterator (const TriaRawIterator template inline @@ -953,6 +972,7 @@ TriaActiveIterator::TriaActiveIterator (const TriaActiveIterator template inline @@ -973,30 +993,37 @@ TriaActiveIterator::TriaActiveIterator (const TriaRawIterator inline -ostream & operator << (ostream &out, const TriaRawIterator &i) { +ostream & operator << (ostream &out, const TriaRawIterator &i) +{ i.print(out); return out; }; + template inline -ostream & operator << (ostream &out, const TriaIterator &i) { +ostream & operator << (ostream &out, const TriaIterator &i) +{ i.print(out); return out; }; + template inline -ostream & operator << (ostream &out, const TriaActiveIterator &i) { +ostream & operator << (ostream &out, const TriaActiveIterator &i) +{ i.print(out); return out; }; + // if in optimized mode: include more templates #ifndef DEBUG # include "tria_iterator.templates.h"