From 0e1241d9a1f8014174087b5d24021456055949df Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Thu, 28 May 2020 18:23:23 -0400 Subject: [PATCH] Fix compiling with gcc with C++20 --- include/deal.II/base/linear_index_iterator.h | 22 ++++++++------------ 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/include/deal.II/base/linear_index_iterator.h b/include/deal.II/base/linear_index_iterator.h index d69845f212..f74ca0f289 100644 --- a/include/deal.II/base/linear_index_iterator.h +++ b/include/deal.II/base/linear_index_iterator.h @@ -260,10 +260,16 @@ public: } /** - * Inverse of operator==(). + * Opposite of operator==(). */ - bool - operator!=(const DerivedIterator &) const; + template + friend typename std::enable_if< + std::is_convertible::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::pointer -template -inline bool -LinearIndexIterator:: -operator!=(const DerivedIterator &other) const -{ - return !(*this == other); -} - - - template inline bool LinearIndexIterator:: -- 2.39.5