]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix compiling with clang-10 with C++20 support
authorMatthias Maier <tamiko@43-1.org>
Mon, 25 May 2020 03:49:59 +0000 (22:49 -0500)
committerDaniel Arndt <arndtd@ornl.gov>
Mon, 25 May 2020 20:56:49 +0000 (16:56 -0400)
include/deal.II/base/linear_index_iterator.h
include/deal.II/grid/tria_iterator.h
include/deal.II/grid/tria_iterator.templates.h
source/distributed/fully_distributed_tria.cc

index 2bc0f9e64b4c917e4a97a7000253d0d0ae7dd9c0..663bac355de502f1fbd99edfd9709d675d6a2123 100644 (file)
@@ -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<DerivedIterator, AccessorType>::pointer
 
 template <class DerivedIterator, class AccessorType>
 inline bool
-LinearIndexIterator<DerivedIterator, AccessorType>::
-operator==(const DerivedIterator &other) const
+LinearIndexIterator<DerivedIterator, AccessorType>::operator==(
+  const LinearIndexIterator<DerivedIterator, AccessorType> &other) const
 {
-  const auto &other_2 = static_cast<decltype(*this) &>(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;
 }
 
 
index 71fb1bb4ede437d3510325bfd3829e898bb4279c..c9c6933c9bd97636f7f154e0e76c418791945ebe 100644 (file)
@@ -379,8 +379,10 @@ public:
   /**
    * Compare for equality.
    */
-  bool
-  operator==(const TriaRawIterator &) const;
+  template <typename OtherAccessor = Accessor>
+  typename std::enable_if<std::is_convertible<OtherAccessor, Accessor>::value,
+                          bool>::type
+  operator==(const TriaRawIterator<OtherAccessor> &) const;
 
   /**
    * Compare for inequality.
index d21e52ce1c1274721f14ba3cb095611f4fb9b17f..0092c845918fd06aa628a711b6e2d5a3d706164e 100644 (file)
@@ -82,9 +82,12 @@ TriaRawIterator<Accessor>::operator=(const TriaRawIterator<Accessor> &i)
 
 
 template <typename Accessor>
-inline bool
-TriaRawIterator<Accessor>::
-operator==(const TriaRawIterator<Accessor> &other) const
+template <typename OtherAccessor>
+inline
+  typename std::enable_if<std::is_convertible<OtherAccessor, Accessor>::value,
+                          bool>::type
+  TriaRawIterator<Accessor>::
+  operator==(const TriaRawIterator<OtherAccessor> &other) const
 {
   return accessor == other.accessor;
 }
index 5bfc7b3eccc15fdb7ad649aba159698a6739e445..80c59ecd30ab192d67d3a53a64078533b2f81c40 100644 (file)
@@ -75,13 +75,13 @@ namespace parallel
         this->set_mesh_smoothing(
           static_cast<
             typename dealii::Triangulation<dim, spacedim>::MeshSmoothing>(
-            dealii::Triangulation<dim>::none |
+            dealii::Triangulation<dim, spacedim>::none |
             Triangulation<dim, spacedim>::limit_level_difference_at_vertices));
       else
         this->set_mesh_smoothing(
           static_cast<
             typename dealii::Triangulation<dim, spacedim>::MeshSmoothing>(
-            dealii::Triangulation<dim>::none));
+            dealii::Triangulation<dim, spacedim>::none));
 
       this->set_mesh_smoothing(construction_data.smoothing);
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.