]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix compiling with gcc with C++20 10415/head
authorDaniel Arndt <arndtd@ornl.gov>
Thu, 28 May 2020 22:23:23 +0000 (18:23 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Fri, 29 May 2020 02:30:48 +0000 (22:30 -0400)
include/deal.II/base/linear_index_iterator.h

index d69845f21255f9c25c995aa3c05fefa9ae093cb2..f74ca0f289bb0aadc8111b07a65a1de8a1dc16c9 100644 (file)
@@ -260,10 +260,16 @@ public:
   }
 
   /**
-   * Inverse of operator==().
+   * Opposite of operator==().
    */
-  bool
-  operator!=(const DerivedIterator &) const;
+  template <typename OtherIterator>
+  friend typename std::enable_if<
+    std::is_convertible<OtherIterator, DerivedIterator>::value,
+    bool>::type
+  operator!=(const LinearIndexIterator &left, const OtherIterator &right)
+  {
+    return !(left == right);
+  }
 
   /**
    * Comparison operator: uses the same ordering as operator<(), but also
@@ -451,16 +457,6 @@ inline typename LinearIndexIterator<DerivedIterator, AccessorType>::pointer
 
 
 
-template <class DerivedIterator, class AccessorType>
-inline bool
-LinearIndexIterator<DerivedIterator, AccessorType>::
-operator!=(const DerivedIterator &other) const
-{
-  return !(*this == other);
-}
-
-
-
 template <class DerivedIterator, class AccessorType>
 inline bool
 LinearIndexIterator<DerivedIterator, AccessorType>::

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.