From dd9da5386081121531eb6fce8f21f8838542a1c2 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Tue, 22 Sep 2015 22:00:16 +0300 Subject: [PATCH] disable String(int) ctor MSVC and GCC compilers interprets cv::String a(0) as a valid statement with conversion of "int" argument to "const char*". This patch forbids this expected behaviour. --- modules/core/include/opencv2/core/cvstd.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/core/include/opencv2/core/cvstd.hpp b/modules/core/include/opencv2/core/cvstd.hpp index dff0b20cf4..edae954fff 100644 --- a/modules/core/include/opencv2/core/cvstd.hpp +++ b/modules/core/include/opencv2/core/cvstd.hpp @@ -576,6 +576,8 @@ private: char* allocate(size_t len); // len without trailing 0 void deallocate(); + + String(int); // disabled and invalid. Catch invalid usages like, commandLineParser.has(0) problem }; //! @} core_basic