]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix some comparisons operator for g++-13 with C++20 15660/head
authorDaniel Arndt <arndtd@ornl.gov>
Wed, 5 Jul 2023 15:33:41 +0000 (11:33 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Wed, 5 Jul 2023 15:34:04 +0000 (11:34 -0400)
include/deal.II/base/linear_index_iterator.h

index b3c1b2dcc7ea342db23dada22012b37f7ca1070c..98947746805494ace1f33df96472e375c1759fb7 100644 (file)
@@ -254,25 +254,23 @@ public:
    * the same entry in the same container.
    */
   template <typename OtherIterator>
-  friend std::enable_if_t<
-    std::is_convertible<OtherIterator, DerivedIterator>::value,
-    bool>
-  operator==(const LinearIndexIterator &left, const OtherIterator &right)
+  std::enable_if_t<std::is_convertible<OtherIterator, DerivedIterator>::value,
+                   bool>
+  operator==(const OtherIterator &right) const
   {
     const auto &right_2 = static_cast<const DerivedIterator &>(right);
-    return left.accessor == right_2.accessor;
+    return this->accessor == right_2.accessor;
   }
 
   /**
    * Opposite of operator==().
    */
   template <typename OtherIterator>
-  friend std::enable_if_t<
-    std::is_convertible<OtherIterator, DerivedIterator>::value,
-    bool>
-  operator!=(const LinearIndexIterator &left, const OtherIterator &right)
+  std::enable_if_t<std::is_convertible<OtherIterator, DerivedIterator>::value,
+                   bool>
+  operator!=(const OtherIterator &right) const
   {
-    return !(left == right);
+    return !(*this == right);
   }
 
   /**

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.