From 789599f63d191fd832236ab470a8b3069cd4841f Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Mon, 25 May 2020 22:24:55 -0400 Subject: [PATCH] Fix test --- include/deal.II/base/linear_index_iterator.h | 23 +++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/include/deal.II/base/linear_index_iterator.h b/include/deal.II/base/linear_index_iterator.h index 663bac355d..c90b430840 100644 --- a/include/deal.II/base/linear_index_iterator.h +++ b/include/deal.II/base/linear_index_iterator.h @@ -249,8 +249,16 @@ public: * Comparison operator. Returns true if both iterators point to * the same entry in the same container. */ - bool - operator==(const LinearIndexIterator &) const; + template + friend typename std::enable_if< + std::is_convertible::value, + bool>::type + operator==(const LinearIndexIterator &left, const OtherIterator &right) + { + const auto &right_2 = static_cast(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::pointer -template -inline bool -LinearIndexIterator::operator==( - const LinearIndexIterator &other) const -{ - return accessor.container == other.accessor.container && - accessor.linear_index == other.accessor.linear_index; -} - - - template inline bool LinearIndexIterator:: -- 2.39.5