From 71c9debbb6e093a5cb8bc0e4a0ac351c8e2c0c49 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Tue, 20 Jun 2023 18:25:55 -0400 Subject: [PATCH] Fix ambiguity for TrilinosWrappers::Iterators comparison operators using C++20 --- include/deal.II/lac/trilinos_sparse_matrix.h | 24 +++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) 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); } -- 2.39.5