From: Daniel Arndt Date: Thu, 28 May 2020 22:23:23 +0000 (-0400) Subject: Fix compiling with gcc with C++20 X-Git-Tag: v9.3.0-rc1~1521^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F10415%2Fhead;p=dealii.git Fix compiling with gcc with C++20 --- 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::