From: Alexander Alekhin Date: Thu, 12 Jul 2018 17:14:23 +0000 (+0300) Subject: core: use "explicit" for Matx() ctor X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~1^2~600^2~12^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=33b7028be2a5b6b6d75b8ca7427125c96638888b;p=platform%2Fupstream%2Fopencv.git core: use "explicit" for Matx() ctor --- diff --git a/modules/core/include/opencv2/core/matx.hpp b/modules/core/include/opencv2/core/matx.hpp index e664a3e..bf3f046 100644 --- a/modules/core/include/opencv2/core/matx.hpp +++ b/modules/core/include/opencv2/core/matx.hpp @@ -66,13 +66,14 @@ namespace cv ////////////////////////////// Small Matrix /////////////////////////// //! @cond IGNORED -struct CV_EXPORTS Matx_AddOp {}; -struct CV_EXPORTS Matx_SubOp {}; -struct CV_EXPORTS Matx_ScaleOp {}; -struct CV_EXPORTS Matx_MulOp {}; -struct CV_EXPORTS Matx_DivOp {}; -struct CV_EXPORTS Matx_MatMulOp {}; -struct CV_EXPORTS Matx_TOp {}; +// FIXIT Remove this (especially CV_EXPORTS modifier) +struct CV_EXPORTS Matx_AddOp { Matx_AddOp() {} Matx_AddOp(const Matx_AddOp&) {} }; +struct CV_EXPORTS Matx_SubOp { Matx_SubOp() {} Matx_SubOp(const Matx_SubOp&) {} }; +struct CV_EXPORTS Matx_ScaleOp { Matx_ScaleOp() {} Matx_ScaleOp(const Matx_ScaleOp&) {} }; +struct CV_EXPORTS Matx_MulOp { Matx_MulOp() {} Matx_MulOp(const Matx_MulOp&) {} }; +struct CV_EXPORTS Matx_DivOp { Matx_DivOp() {} Matx_DivOp(const Matx_DivOp&) {} }; +struct CV_EXPORTS Matx_MatMulOp { Matx_MatMulOp() {} Matx_MatMulOp(const Matx_MatMulOp&) {} }; +struct CV_EXPORTS Matx_TOp { Matx_TOp() {} Matx_TOp(const Matx_TOp&) {} }; //! @endcond /** @brief Template class for small matrices whose type and size are known at compilation time @@ -118,7 +119,7 @@ public: //! default constructor Matx(); - Matx(_Tp v0); //!< 1x1 matrix + explicit Matx(_Tp v0); //!< 1x1 matrix Matx(_Tp v0, _Tp v1); //!< 1x2 or 2x1 matrix Matx(_Tp v0, _Tp v1, _Tp v2); //!< 1x3 or 3x1 matrix Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3); //!< 1x4, 2x2 or 4x1 matrix diff --git a/modules/core/test/test_operations.cpp b/modules/core/test/test_operations.cpp index bb1aab3..1bdf516 100644 --- a/modules/core/test/test_operations.cpp +++ b/modules/core/test/test_operations.cpp @@ -794,13 +794,13 @@ bool CV_OperationsTest::TestTemplateMat() Size size(2, 5); TestType(size, 1.f); - cv::Vec3f val1 = 1.f; + cv::Vec3f val1(1.f); TestType(size, val1); - cv::Matx31f val2 = 1.f; + cv::Matx31f val2(1.f); TestType(size, val2); - cv::Matx41f val3 = 1.f; + cv::Matx41f val3(1.f); TestType(size, val3); - cv::Matx32f val4 = 1.f; + cv::Matx32f val4(1.f); TestType(size, val4); } catch (const test_excep& e)