From e9a2e665b25efc3fd2c8d800c85cf74eab7997dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= Date: Sat, 29 Jun 2019 20:28:24 +0200 Subject: [PATCH] Explicitly default operator= for Vec MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Due to the explicitly declared copy constructor Vec::Vec(Vec &) GCC 9 warns if there is no assignment operator, as having one typically requires the other (rule-of-three, constructor/desctructor/assginment). As the values are just a plain array the default assignment operator does the right thing. Tell the compiler explicitly to default it. Signed-off-by: Stefan BrĂ¼ns --- modules/core/include/opencv2/core/matx.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/core/include/opencv2/core/matx.hpp b/modules/core/include/opencv2/core/matx.hpp index d8e17e7015..f017b0910f 100644 --- a/modules/core/include/opencv2/core/matx.hpp +++ b/modules/core/include/opencv2/core/matx.hpp @@ -391,6 +391,10 @@ public: const _Tp& operator ()(int i) const; _Tp& operator ()(int i); +#ifdef CV_CXX11 + Vec<_Tp, cn>& operator=(const Vec<_Tp, cn>& rhs) = default; +#endif + Vec(const Matx<_Tp, cn, 1>& a, const Matx<_Tp, cn, 1>& b, Matx_AddOp); Vec(const Matx<_Tp, cn, 1>& a, const Matx<_Tp, cn, 1>& b, Matx_SubOp); template Vec(const Matx<_Tp, cn, 1>& a, _T2 alpha, Matx_ScaleOp);