From: Daniel Garcia-Sanchez Date: Wed, 24 Jul 2019 18:47:54 +0000 (+0200) Subject: Add Point assignment operator X-Git-Tag: v9.2.0-rc1~1358^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f275afdddc9ea074ab6097fc04268d52a0ba6ed3;p=dealii.git Add Point assignment operator Assignment operator from a Tensor<1, dim, Number> with different underlying scalar type. --- diff --git a/include/deal.II/base/point.h b/include/deal.II/base/point.h index 3afb0fa319..f2836107ec 100644 --- a/include/deal.II/base/point.h +++ b/include/deal.II/base/point.h @@ -195,6 +195,15 @@ public: DEAL_II_CUDA_HOST_DEV Number & operator()(const unsigned int index); + /** + * Assignment operator from Tensor<1, dim, Number> with different underlying + * scalar type. This obviously requires that the @p OtherNumber type is + * convertible to @p Number. + */ + template + Point & + operator=(const Tensor<1, dim, OtherNumber> &p); + /** * @name Addition and subtraction of points. * @{ @@ -481,6 +490,17 @@ Point::operator()(const unsigned int index) +template +template +inline DEAL_II_ALWAYS_INLINE Point & +Point::operator=(const Tensor<1, dim, OtherNumber> &p) +{ + Tensor<1, dim, Number>::operator=(p); + return *this; +} + + + template inline DEAL_II_CUDA_HOST_DEV Point Point::operator+(const Tensor<1, dim, Number> &p) const