From a94f96e3737e887ef762137d90ac1497268ffb82 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Sat, 12 Jan 2019 15:15:25 +0100 Subject: [PATCH] Actually delete copy constructors for FEValues* --- include/deal.II/fe/fe_values.h | 28 ++++++++++----------- source/fe/fe_values.cc | 45 ---------------------------------- 2 files changed, 13 insertions(+), 60 deletions(-) diff --git a/include/deal.II/fe/fe_values.h b/include/deal.II/fe/fe_values.h index e0f09e6a50..724506943b 100644 --- a/include/deal.II/fe/fe_values.h +++ b/include/deal.II/fe/fe_values.h @@ -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 &); + operator=(const Scalar &) = 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 &); + operator=(const Vector &) = 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 & mapping, const FiniteElement &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. */ diff --git a/source/fe/fe_values.cc b/source/fe/fe_values.cc index 0f682e841d..b432ec9155 100644 --- a/source/fe/fe_values.cc +++ b/source/fe/fe_values.cc @@ -183,17 +183,6 @@ namespace FEValuesViews - template - Scalar & - Scalar::operator=(const Scalar &) - { - // we shouldn't be copying these objects - Assert(false, ExcInternalError()); - return *this; - } - - - template Vector::Vector(const FEValuesBase &fe_values, const unsigned int first_vector_component) @@ -275,17 +264,6 @@ namespace FEValuesViews - template - Vector & - Vector::operator=(const Vector &) - { - // we shouldn't be copying these objects - Assert(false, ExcInternalError()); - return *this; - } - - - template SymmetricTensor<2, dim, spacedim>::SymmetricTensor( const FEValuesBase &fe_values, @@ -376,18 +354,6 @@ namespace FEValuesViews - template - 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 Tensor<2, dim, spacedim>::Tensor(const FEValuesBase &fe_values, const unsigned int first_tensor_component) @@ -468,17 +434,6 @@ namespace FEValuesViews - template - 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 -- 2.39.5