From 2c1bf17c6b074066e2e5ad935e3d11780ab78ff2 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Thu, 8 Apr 2021 12:07:24 +0200 Subject: [PATCH] Explicit assignment in copy constructors --- include/vectorwrapper/vectorwrapper.hpp.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/vectorwrapper/vectorwrapper.hpp.in b/include/vectorwrapper/vectorwrapper.hpp.in index b3de476..e1987ea 100644 --- a/include/vectorwrapper/vectorwrapper.hpp.in +++ b/include/vectorwrapper/vectorwrapper.hpp.in @@ -252,7 +252,7 @@ namespace vwr { static const Vec unit_x; Vec ( void ) = default; - Vec ( const Vec& ) = default; + Vec ( const Vec& parOther ) { implem::assign_same_type(*this, parOther); } Vec ( const vector_type& parIn ) : implem::VecBase(parIn) { } template explicit Vec ( const typename std::enable_if::value and not std::is_same::value, T>::type& parX ) : implem::VecBase(parX) { } @@ -280,7 +280,7 @@ namespace vwr { static const Vec unit_y; Vec ( void ) = default; - Vec ( const Vec& ) = default; + Vec ( const Vec& parOther ) { implem::assign_same_type(*this, parOther); } Vec ( const vector_type& parIn ) : implem::VecBase(parIn) { } explicit Vec ( const scalar_type parX ) : implem::VecBase(parX) { } Vec ( scalar_type parX, scalar_type parY ) : implem::VecBase(parX, parY) { } @@ -310,7 +310,7 @@ namespace vwr { static const Vec unit_z; Vec ( void ) = default; - Vec ( const Vec& ) = default; + Vec ( const Vec& parOther ) { implem::assign_same_type(*this, parOther); } Vec ( const vector_type& parIn ) : implem::VecBase(parIn) { } explicit Vec ( const scalar_type parX ) : implem::VecBase(parX) { } Vec ( scalar_type parX, scalar_type parY, scalar_type parZ ) : implem::VecBase(parX, parY, parZ) { } @@ -341,7 +341,7 @@ namespace vwr { static const Vec unit_w; Vec ( void ) = default; - Vec ( const Vec& ) = default; + Vec ( const Vec& parOther ) { implem::assign_same_type(*this, parOther); } Vec ( const vector_type& parIn ) : implem::VecBase(parIn) { } explicit Vec ( const scalar_type parX ) : implem::VecBase(parX) { } Vec ( scalar_type parX, scalar_type parY, scalar_type parZ, scalar_type parW ) : implem::VecBase(parX, parY, parZ, parW) { }