]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix MatrixIterator comparison operator for C++20 14937/head
authorDaniel Arndt <arndtd@ornl.gov>
Tue, 21 Mar 2023 21:47:24 +0000 (17:47 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Tue, 21 Mar 2023 21:52:17 +0000 (17:52 -0400)
include/deal.II/lac/matrix_iterator.h

index 9374c46beee78d42d9dd289148a454c959f4468b..cc7cfe1834cbf5c8480d38757e0d393de755ab64 100644 (file)
@@ -87,14 +87,16 @@ public:
   /**
    * Comparison. True, if both accessors are equal.
    */
+  template <class OtherAccessor>
   bool
-  operator==(const MatrixIterator &) const;
+  operator==(const MatrixIterator<OtherAccessor> &) const;
 
   /**
    * Inverse of <tt>==</tt>.
    */
+  template <class OtherAccessor>
   bool
-  operator!=(const MatrixIterator &) const;
+  operator!=(const MatrixIterator<OtherAccessor> &) const;
 
   /**
    * Comparison operator. Result is true if either the first row number is
@@ -178,16 +180,20 @@ MatrixIterator<ACCESSOR>::operator->() const
 
 
 template <class ACCESSOR>
+template <class OtherAccessor>
 inline bool
-MatrixIterator<ACCESSOR>::operator==(const MatrixIterator &other) const
+MatrixIterator<ACCESSOR>::operator==(
+  const MatrixIterator<OtherAccessor> &other) const
 {
   return (accessor == other.accessor);
 }
 
 
 template <class ACCESSOR>
+template <class OtherAccessor>
 inline bool
-MatrixIterator<ACCESSOR>::operator!=(const MatrixIterator &other) const
+MatrixIterator<ACCESSOR>::operator!=(
+  const MatrixIterator<OtherAccessor> &other) const
 {
   return !(*this == other);
 }

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


Typeset in Trocchi and Trocchi Bold Sans Serif.