diff --git a/modules/core/include/opencv2/core/mat.hpp b/modules/core/include/opencv2/core/mat.hpp index 8f7f6c4dfb..990deb87de 100644 --- a/modules/core/include/opencv2/core/mat.hpp +++ b/modules/core/include/opencv2/core/mat.hpp @@ -53,6 +53,10 @@ #include "opencv2/core/bufferpool.hpp" +#ifdef CV_CXX11 +#include +#endif + namespace cv { @@ -988,7 +992,8 @@ public: #ifdef CV_CXX11 /** @overload */ - template explicit Mat(const std::initializer_list<_Tp> list); + template::value>::type> + explicit Mat(const std::initializer_list<_Tp> list); #endif #ifdef CV_CXX_STD_ARRAY diff --git a/modules/core/include/opencv2/core/mat.inl.hpp b/modules/core/include/opencv2/core/mat.inl.hpp index 2df2e40102..f1d69b4b04 100644 --- a/modules/core/include/opencv2/core/mat.inl.hpp +++ b/modules/core/include/opencv2/core/mat.inl.hpp @@ -575,7 +575,7 @@ Mat::Mat(const std::vector<_Tp>& vec, bool copyData) } #ifdef CV_CXX11 -template inline +template inline Mat::Mat(const std::initializer_list<_Tp> list) : flags(MAGIC_VAL | DataType<_Tp>::type | CV_MAT_CONT_FLAG), dims(2), rows((int)list.size()), cols(1), data(0), datastart(0), dataend(0), datalimit(0), allocator(0), u(0), size(&rows), step(0)