Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MatrixIterator comparison operator for C++20 #14937

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 10 additions & 4 deletions include/deal.II/lac/matrix_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,16 @@ class MatrixIterator
/**
* Comparison. True, if both accessors are equal.
*/
template <class OtherAccessor>
bool
operator==(const MatrixIterator &) const;
operator==(const MatrixIterator<OtherAccessor> &) const;

/**
* Inverse of <tt>==</tt>.
*/
template <class OtherAccessor>
bool
operator!=(const MatrixIterator &) const;
operator!=(const MatrixIterator<OtherAccessor> &) const;

/**
* Comparison operator. Result is true if either the first row number is
Expand Down Expand Up @@ -178,16 +180,20 @@ MatrixIterator<ACCESSOR>::operator->() const


template <class ACCESSOR>
template <class OtherAccessor>
inline bool
MatrixIterator<ACCESSOR>::operator==(const MatrixIterator &other) const
MatrixIterator<ACCESSOR>::operator==(
const MatrixIterator<OtherAccessor> &other) const
{
return (accessor == other.accessor);
}


template <class ACCESSOR>
template <class OtherAccessor>
inline bool
MatrixIterator<ACCESSOR>::operator!=(const MatrixIterator &other) const
MatrixIterator<ACCESSOR>::operator!=(
const MatrixIterator<OtherAccessor> &other) const
{
return !(*this == other);
}
Expand Down