* <tt>i</tt>th index.
*/
unsigned int operator[] (const unsigned int i) const;
-
+
+ /**
+ * Compare two index fields for
+ * equality.
+ */
+ bool operator == (const TableIndicesBase<N> &other) const;
+
+ /**
+ * Compare two index fields for
+ * inequality.
+ */
+ bool operator != (const TableIndicesBase<N> &other) const;
+
protected:
/**
* Store the indices in an array.
+template <int N>
+inline
+bool
+TableIndicesBase<N>::operator == (const TableIndicesBase<N> &other) const
+{
+ for (unsigned int i=0; i<N; ++i)
+ if (indices[i] != other.indices[i])
+ return false;
+ return true;
+}
+
+
+
+template <int N>
+inline
+bool
+TableIndicesBase<N>::operator != (const TableIndicesBase<N> &other) const
+{
+ return !(*this == other);
+}
+
+
+
inline
TableIndices<1>::TableIndices ()
{
<h3>base</h3>
<ol>
+ <li> <p>
+ New: Class <code class="class">TableIndices</code> now has
+ operators that check for equality and inequality of objects.
+ <br>
+ (WB 2004/07/28)
+ </p>
+
<li> <p>
New: A class <code class="class">PointerComparison</code> for comparing
pointers that may or may not be of the same type.
In the beginning the Universe was created. This has made a lot of
people very angry and has been widely regarded as a bad move.
Douglas Adams