From 7be0c785338db8f615bc8f5de7cd173f5d30dc63 Mon Sep 17 00:00:00 2001 From: Patrik Huber Date: Sat, 17 Feb 2018 11:53:30 +0000 Subject: [PATCH] Merge pull request #10589 from patrikhuber:patch-1 * Make #ifdef true for MSVC I think MSVC had `std::array` for quite a while (possibly going back as far as VS 2012, but it's definitely there in 2015 and 2017. So I think `_MSC_VER` `1900` is a safe bet. Probably `1800` and maybe even `1700` could work as well but I can't test that locally. * fix test --- modules/core/include/opencv2/core/cvdef.h | 2 +- modules/core/test/test_mat.cpp | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/modules/core/include/opencv2/core/cvdef.h b/modules/core/include/opencv2/core/cvdef.h index 823a2693f1..c073d652af 100644 --- a/modules/core/include/opencv2/core/cvdef.h +++ b/modules/core/include/opencv2/core/cvdef.h @@ -442,7 +442,7 @@ Cv64suf; \****************************************************************************************/ #ifndef CV_CXX_STD_ARRAY -# if __cplusplus >= 201103L +# if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900/*MSVS 2015*/) # define CV_CXX_STD_ARRAY 1 # include # endif diff --git a/modules/core/test/test_mat.cpp b/modules/core/test/test_mat.cpp index 0d8a4af31c..14229acb2c 100644 --- a/modules/core/test/test_mat.cpp +++ b/modules/core/test/test_mat.cpp @@ -1672,9 +1672,9 @@ TEST(Core_Mat_array, copyTo_roi_row) TEST(Core_Mat_array, SplitMerge) { std::array src; - for(size_t i=0; i dst; split(merged, dst); - Mat diff; - for(size_t i=0; i