]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Actually delete copy constructors for FEValues* 7596/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sat, 12 Jan 2019 14:15:25 +0000 (15:15 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sat, 12 Jan 2019 14:28:19 +0000 (15:28 +0100)
include/deal.II/fe/fe_values.h
source/fe/fe_values.cc

index e0f09e6a507d48bde2a91df175bca601bb42d45c..724506943bd95505e546ad384b6b44954e12ee0a 100644 (file)
@@ -261,10 +261,10 @@ namespace FEValuesViews
 
     /**
      * Copy operator. This is not a lightweight object so we don't allow
-     * copying and generate an exception if this function is called.
+     * copying and generate a compile-time error if this function is called.
      */
     Scalar &
-    operator=(const Scalar<dim, spacedim> &);
+    operator=(const Scalar<dim, spacedim> &) = delete;
 
     /**
      * Return the value of the vector component selected by this view, for the
@@ -767,10 +767,10 @@ namespace FEValuesViews
 
     /**
      * Copy operator. This is not a lightweight object so we don't allow
-     * copying and generate an exception if this function is called.
+     * copying and generate a compile-time error if this function is called.
      */
     Vector &
-    operator=(const Vector<dim, spacedim> &);
+    operator=(const Vector<dim, spacedim> &) = delete;
 
     /**
      * Return the value of the vector components selected by this view, for
@@ -1363,10 +1363,10 @@ namespace FEValuesViews
 
     /**
      * Copy operator. This is not a lightweight object so we don't allow
-     * copying and generate an exception if this function is called.
+     * copying and generate a compile-time error if this function is called.
      */
     SymmetricTensor &
-    operator=(const SymmetricTensor<2, dim, spacedim> &);
+    operator=(const SymmetricTensor<2, dim, spacedim> &) = delete;
 
     /**
      * Return the value of the vector components selected by this view, for
@@ -1659,10 +1659,10 @@ namespace FEValuesViews
 
     /**
      * Copy operator. This is not a lightweight object so we don't allow
-     * copying and generate an exception if this function is called.
+     * copying and generate a compile-time error if this function is called.
      */
     Tensor &
-    operator=(const Tensor<2, dim, spacedim> &);
+    operator=(const Tensor<2, dim, spacedim> &) = delete;
 
     /**
      * Return the value of the vector components selected by this view, for
@@ -2045,6 +2045,11 @@ public:
                const Mapping<dim, spacedim> &      mapping,
                const FiniteElement<dim, spacedim> &fe);
 
+  /**
+   * The copy operator is deleted since objects of this class are not copyable.
+   */
+  FEValuesBase &
+  operator=(const FEValuesBase &) = delete;
 
   /**
    * Destructor.
@@ -3392,13 +3397,6 @@ private:
    */
   FEValuesBase(const FEValuesBase &);
 
-  /**
-   * Copy operator. Since objects of this class are not copyable, we make it
-   * private, and also do not implement it.
-   */
-  FEValuesBase &
-  operator=(const FEValuesBase &);
-
   /**
    * A cache for all possible FEValuesViews objects.
    */
index 0f682e841df96f2d5cdac54ef7daffed6dfc9bcd..b432ec9155e2a961c7242ad61c09a117a1eecef5 100644 (file)
@@ -183,17 +183,6 @@ namespace FEValuesViews
 
 
 
-  template <int dim, int spacedim>
-  Scalar<dim, spacedim> &
-  Scalar<dim, spacedim>::operator=(const Scalar<dim, spacedim> &)
-  {
-    // we shouldn't be copying these objects
-    Assert(false, ExcInternalError());
-    return *this;
-  }
-
-
-
   template <int dim, int spacedim>
   Vector<dim, spacedim>::Vector(const FEValuesBase<dim, spacedim> &fe_values,
                                 const unsigned int first_vector_component)
@@ -275,17 +264,6 @@ namespace FEValuesViews
 
 
 
-  template <int dim, int spacedim>
-  Vector<dim, spacedim> &
-  Vector<dim, spacedim>::operator=(const Vector<dim, spacedim> &)
-  {
-    // we shouldn't be copying these objects
-    Assert(false, ExcInternalError());
-    return *this;
-  }
-
-
-
   template <int dim, int spacedim>
   SymmetricTensor<2, dim, spacedim>::SymmetricTensor(
     const FEValuesBase<dim, spacedim> &fe_values,
@@ -376,18 +354,6 @@ namespace FEValuesViews
 
 
 
-  template <int dim, int spacedim>
-  SymmetricTensor<2, dim, spacedim> &
-  SymmetricTensor<2, dim, spacedim>::
-  operator=(const SymmetricTensor<2, dim, spacedim> &)
-  {
-    // we shouldn't be copying these objects
-    Assert(false, ExcInternalError());
-    return *this;
-  }
-
-
-
   template <int dim, int spacedim>
   Tensor<2, dim, spacedim>::Tensor(const FEValuesBase<dim, spacedim> &fe_values,
                                    const unsigned int first_tensor_component)
@@ -468,17 +434,6 @@ namespace FEValuesViews
 
 
 
-  template <int dim, int spacedim>
-  Tensor<2, dim, spacedim> &
-  Tensor<2, dim, spacedim>::operator=(const Tensor<2, dim, spacedim> &)
-  {
-    // we shouldn't be copying these objects
-    Assert(false, ExcInternalError());
-    return *this;
-  }
-
-
-
   namespace internal
   {
     // Given values of degrees of freedom, evaluate the

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.