]> https://gitweb.dealii.org/ - dealii-svn.git/commit
Remove a conversion operator from VectorView to Vector. The problem is that
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 13 Jul 2012 17:42:49 +0000 (17:42 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 13 Jul 2012 17:42:49 +0000 (17:42 +0000)
commit232b0ed8d980a2c6e584c219f09284aa81679d6f
tree76eaeff388fc169a547d007ec26eceef8af365e8
parent561167c68e5a8020f56d18f57c96922468315dda
Remove a conversion operator from VectorView to Vector. The problem is that
this operator here:

                                     /**
                                      * Implicit cast to const
                                      * Vector<Number>. This cast
                                      * allows the use of this object
                                      * everywhere a const
                                      * Vector<double> is required.
                                      */
    operator const Vector<Number> &() const;

will never be called as per the C++ standard because VectorView is derived
from Vector<Number> and the standard says this:

    A conversion function is never used to convert a (possibly cv-qualified)
    object to the (possibly cv-qualified) same object type (or a reference to
    it), to a (possibly cv-qualified) base class of that type (or a reference
    to it), or to (possibly cv-qualified) void.

Note the piece about the base class. In other words, the presence of the
operator in the current implementation has no impact since it will never be
called.

This also fixes the following warning from ICC:

/scratch/bangert/p/deal.II/1/deal.II/include/deal.II/lac/vector_view.h(173): warning #597: "dealii::VectorView<Number>::operator const dealii::Vector<PetscScalar={double}> &() const [with Number=PetscScalar={double}]" will not be called for implicit or explicit conversions
      operator const Vector<Number> &() const;
      ^
          detected during:
            instantiation of class "dealii::VectorView<Number> [with Number=PetscScalar={double}]" at line 925 of "/scratch/bangert/p/deal.II/1/deal.II/include/deal.II/lac/parallel_vector.h"
            instantiation of class "dealii::parallel::distributed::Vector<Number> [with Number=double]" at line 1023 of "/scratch/bangert/p/deal.II/1/deal.II/source/numerics/error_estimator.cc"
            instantiation of "void dealii::KellyErrorEstimator<1, spacedim>::estimate(const dealii::Mapping<1, spacedim> &, const DH &, const dealii::Quadrature<0> &, const dealii::FunctionMap<spacedim>::type &, const InputVector &, dealii::Vector<float> &, const std::vector<bool, std::allocator<bool>> &, const dealii::Function<spacedim> *, unsigned int, dealii::types::subdomain_id_t={unsigned int}, dealii::types::material_id_t={unsigned char}) [with spacedim=1,
                      InputVector=dealii::parallel::distributed::Vector<double>, DH=dealii::DoFHandler<1, 1>]" at line 156 of "/scratch/bangert/p/deal.II/1/deal.II/source/numerics/error_estimator.inst"

git-svn-id: https://svn.dealii.org/trunk@25696 0785d39b-7218-0410-832d-ea1e28bc413d
deal.II/include/deal.II/lac/vector_view.h

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.