From: Daniel Arndt Date: Tue, 20 Jun 2023 22:25:55 +0000 (-0400) Subject: Fix ambiguity for TrilinosWrappers::Iterators comparison operators using C++20 X-Git-Tag: v9.5.0-rc1~74^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71c9debbb6e093a5cb8bc0e4a0ac351c8e2c0c49;p=dealii.git Fix ambiguity for TrilinosWrappers::Iterators comparison operators using C++20 --- diff --git a/include/deal.II/lac/trilinos_sparse_matrix.h b/include/deal.II/lac/trilinos_sparse_matrix.h index bf622d84a0..90d38d138e 100644 --- a/include/deal.II/lac/trilinos_sparse_matrix.h +++ b/include/deal.II/lac/trilinos_sparse_matrix.h @@ -415,28 +415,32 @@ namespace TrilinosWrappers * Comparison. True, if both iterators point to the same matrix * position. */ + template bool - operator==(const Iterator &) const; + operator==(const Iterator &) const; /** * Inverse of ==. */ + template bool - operator!=(const Iterator &) const; + operator!=(const Iterator &) const; /** * Comparison operator. Result is true if either the first row number is * smaller or if the row numbers are equal and the first index is * smaller. */ + template bool - operator<(const Iterator &) const; + operator<(const Iterator &) const; /** * Comparison operator. The opposite of the previous operator */ + template bool - operator>(const Iterator &) const; + operator>(const Iterator &) const; /** * Exception @@ -2706,8 +2710,9 @@ namespace TrilinosWrappers template + template inline bool - Iterator::operator==(const Iterator &other) const + Iterator::operator==(const Iterator &other) const { return (accessor.a_row == other.accessor.a_row && accessor.a_index == other.accessor.a_index); @@ -2716,8 +2721,9 @@ namespace TrilinosWrappers template + template inline bool - Iterator::operator!=(const Iterator &other) const + Iterator::operator!=(const Iterator &other) const { return !(*this == other); } @@ -2725,8 +2731,9 @@ namespace TrilinosWrappers template + template inline bool - Iterator::operator<(const Iterator &other) const + Iterator::operator<(const Iterator &other) const { return (accessor.row() < other.accessor.row() || (accessor.row() == other.accessor.row() && @@ -2735,8 +2742,9 @@ namespace TrilinosWrappers template + template inline bool - Iterator::operator>(const Iterator &other) const + Iterator::operator>(const Iterator &other) const { return (other < *this); }