From b9882819b9881522d609ceca6f2a8819c0c745a8 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Sun, 24 May 2020 22:49:59 -0500 Subject: [PATCH] Fix compiling with clang-10 with C++20 support --- include/deal.II/base/linear_index_iterator.h | 11 +++++------ include/deal.II/grid/tria_iterator.h | 6 ++++-- include/deal.II/grid/tria_iterator.templates.h | 9 ++++++--- source/distributed/fully_distributed_tria.cc | 4 ++-- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/include/deal.II/base/linear_index_iterator.h b/include/deal.II/base/linear_index_iterator.h index 2bc0f9e64b..663bac355d 100644 --- a/include/deal.II/base/linear_index_iterator.h +++ b/include/deal.II/base/linear_index_iterator.h @@ -250,7 +250,7 @@ public: * the same entry in the same container. */ bool - operator==(const DerivedIterator &) const; + operator==(const LinearIndexIterator &) const; /** * Inverse of operator==(). @@ -446,12 +446,11 @@ inline typename LinearIndexIterator::pointer template inline bool -LinearIndexIterator:: -operator==(const DerivedIterator &other) const +LinearIndexIterator::operator==( + const LinearIndexIterator &other) const { - const auto &other_2 = static_cast(other); - return accessor.container == other_2.accessor.container && - accessor.linear_index == other_2.accessor.linear_index; + return accessor.container == other.accessor.container && + accessor.linear_index == other.accessor.linear_index; } diff --git a/include/deal.II/grid/tria_iterator.h b/include/deal.II/grid/tria_iterator.h index 71fb1bb4ed..c9c6933c9b 100644 --- a/include/deal.II/grid/tria_iterator.h +++ b/include/deal.II/grid/tria_iterator.h @@ -379,8 +379,10 @@ public: /** * Compare for equality. */ - bool - operator==(const TriaRawIterator &) const; + template + typename std::enable_if::value, + bool>::type + operator==(const TriaRawIterator &) const; /** * Compare for inequality. diff --git a/include/deal.II/grid/tria_iterator.templates.h b/include/deal.II/grid/tria_iterator.templates.h index d21e52ce1c..0092c84591 100644 --- a/include/deal.II/grid/tria_iterator.templates.h +++ b/include/deal.II/grid/tria_iterator.templates.h @@ -82,9 +82,12 @@ TriaRawIterator::operator=(const TriaRawIterator &i) template -inline bool -TriaRawIterator:: -operator==(const TriaRawIterator &other) const +template +inline + typename std::enable_if::value, + bool>::type + TriaRawIterator:: + operator==(const TriaRawIterator &other) const { return accessor == other.accessor; } diff --git a/source/distributed/fully_distributed_tria.cc b/source/distributed/fully_distributed_tria.cc index 5bfc7b3ecc..80c59ecd30 100644 --- a/source/distributed/fully_distributed_tria.cc +++ b/source/distributed/fully_distributed_tria.cc @@ -75,13 +75,13 @@ namespace parallel this->set_mesh_smoothing( static_cast< typename dealii::Triangulation::MeshSmoothing>( - dealii::Triangulation::none | + dealii::Triangulation::none | Triangulation::limit_level_difference_at_vertices)); else this->set_mesh_smoothing( static_cast< typename dealii::Triangulation::MeshSmoothing>( - dealii::Triangulation::none)); + dealii::Triangulation::none)); this->set_mesh_smoothing(construction_data.smoothing); -- 2.39.5