]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix test
authorDaniel Arndt <arndtd@ornl.gov>
Tue, 26 May 2020 02:24:55 +0000 (22:24 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Tue, 26 May 2020 02:35:02 +0000 (22:35 -0400)
include/deal.II/base/linear_index_iterator.h

index 663bac355de502f1fbd99edfd9709d675d6a2123..c90b430840548c9c46bef3d1cd60c616cfcace1e 100644 (file)
@@ -249,8 +249,16 @@ public:
    * Comparison operator. Returns <code>true</code> if both iterators point to
    * the same entry in the same container.
    */
-  bool
-  operator==(const LinearIndexIterator &) const;
+  template <typename OtherIterator>
+  friend typename std::enable_if<
+    std::is_convertible<OtherIterator, DerivedIterator>::value,
+    bool>::type
+  operator==(const LinearIndexIterator &left, const OtherIterator &right)
+  {
+    const auto &right_2 = static_cast<const DerivedIterator &>(right);
+    return left.accessor.container == right_2.accessor.container &&
+           left.accessor.linear_index == right_2.accessor.linear_index;
+  }
 
   /**
    * Inverse of operator==().
@@ -444,17 +452,6 @@ inline typename LinearIndexIterator<DerivedIterator, AccessorType>::pointer
 
 
 
-template <class DerivedIterator, class AccessorType>
-inline bool
-LinearIndexIterator<DerivedIterator, AccessorType>::operator==(
-  const LinearIndexIterator<DerivedIterator, AccessorType> &other) const
-{
-  return accessor.container == other.accessor.container &&
-         accessor.linear_index == other.accessor.linear_index;
-}
-
-
-
 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.