From ff0601cda5042b1d8a2fd81a60ee9e8a8370ed82 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Mon, 30 May 2016 17:49:54 +0300 Subject: [PATCH] core: prevent changes in 'std' namespace --- modules/core/include/opencv2/core/cvstd.hpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/modules/core/include/opencv2/core/cvstd.hpp b/modules/core/include/opencv2/core/cvstd.hpp index edae954fff..f960e767cd 100644 --- a/modules/core/include/opencv2/core/cvstd.hpp +++ b/modules/core/include/opencv2/core/cvstd.hpp @@ -67,6 +67,11 @@ namespace cv { + static inline uchar abs(uchar a) { return a; } + static inline ushort abs(ushort a) { return a; } + static inline unsigned abs(unsigned a) { return a; } + static inline uint64 abs(uint64 a) { return a; } + using std::min; using std::max; using std::abs; @@ -77,14 +82,6 @@ namespace cv using std::log; } -namespace std -{ - static inline uchar abs(uchar a) { return a; } - static inline ushort abs(ushort a) { return a; } - static inline unsigned abs(unsigned a) { return a; } - static inline uint64 abs(uint64 a) { return a; } -} - #else namespace cv { -- GitLab