mirror of
https://github.com/opencv/opencv.git
synced 2025-06-10 19:24:07 +08:00
core: add CV_CXX_11 flag to cvdef.h
This commit is contained in:
parent
3c748ccf10
commit
08db55fb62
@ -358,6 +358,20 @@ Cv64suf;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/****************************************************************************************\
|
||||||
|
* C++ 11 *
|
||||||
|
\****************************************************************************************/
|
||||||
|
#ifndef CV_CXX_11
|
||||||
|
# if __cplusplus >= 201103L || defined(_MSC_VER) && _MSC_VER >= 1600
|
||||||
|
# define CV_CXX_11 1
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
# if CV_CXX_11 == 0
|
||||||
|
# undef CV_CXX_11
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************\
|
/****************************************************************************************\
|
||||||
* C++ Move semantics *
|
* C++ Move semantics *
|
||||||
\****************************************************************************************/
|
\****************************************************************************************/
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
#include "opencv2/core.hpp"
|
#include "opencv2/core.hpp"
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
|
|
||||||
#if __cplusplus >= 201103L
|
#ifdef CV_CXX_11
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -482,7 +482,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
CV_EXPORTS void parallel_for_(const Range& range, const ParallelLoopBody& body, double nstripes=-1.);
|
CV_EXPORTS void parallel_for_(const Range& range, const ParallelLoopBody& body, double nstripes=-1.);
|
||||||
|
|
||||||
#if __cplusplus >= 201103L
|
#ifdef CV_CXX_11
|
||||||
class ParallelLoopBodyLambdaWrapper : public ParallelLoopBody
|
class ParallelLoopBodyLambdaWrapper : public ParallelLoopBody
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
@ -102,7 +102,7 @@ int main()
|
|||||||
|
|
||||||
double t1 = (double) getTickCount();
|
double t1 = (double) getTickCount();
|
||||||
|
|
||||||
#if __cplusplus >= 201103L
|
#ifdef CV_CXX_11
|
||||||
|
|
||||||
//! [mandelbrot-parallel-call-cxx11]
|
//! [mandelbrot-parallel-call-cxx11]
|
||||||
parallel_for_(Range(0, mandelbrotImg.rows*mandelbrotImg.cols), [&](const Range& range){
|
parallel_for_(Range(0, mandelbrotImg.rows*mandelbrotImg.cols), [&](const Range& range){
|
||||||
|
Loading…
Reference in New Issue
Block a user