diff --git a/samples/cpp/cloning_gui.cpp b/samples/cpp/cloning_gui.cpp index b8ac07ff06..14a5079ac0 100644 --- a/samples/cpp/cloning_gui.cpp +++ b/samples/cpp/cloning_gui.cpp @@ -39,7 +39,12 @@ #include #include -using namespace std; +// we're NOT "using namespace std;" here, to avoid collisions between the beta variable and std::beta in c++17 +using std::cin; +using std::cout; +using std::endl; +using std::string; + using namespace cv; Mat img0, img1, img2, res, res1, final, final1, blend; diff --git a/samples/cpp/tutorial_code/HighGUI/BasicLinearTransformsTrackbar.cpp b/samples/cpp/tutorial_code/HighGUI/BasicLinearTransformsTrackbar.cpp index 563e35dc2b..12cdebf00f 100644 --- a/samples/cpp/tutorial_code/HighGUI/BasicLinearTransformsTrackbar.cpp +++ b/samples/cpp/tutorial_code/HighGUI/BasicLinearTransformsTrackbar.cpp @@ -8,6 +8,7 @@ #include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" +// we're NOT "using namespace std;" here, to avoid collisions between the beta variable and std::beta in c++17 using namespace cv; /** Global Variables */ diff --git a/samples/cpp/tutorial_code/ImgProc/BasicLinearTransforms.cpp b/samples/cpp/tutorial_code/ImgProc/BasicLinearTransforms.cpp index 0f325545c8..49ee1bf215 100644 --- a/samples/cpp/tutorial_code/ImgProc/BasicLinearTransforms.cpp +++ b/samples/cpp/tutorial_code/ImgProc/BasicLinearTransforms.cpp @@ -8,7 +8,10 @@ #include "opencv2/highgui.hpp" #include -using namespace std; +// we're NOT "using namespace std;" here, to avoid collisions between the beta variable and std::beta in c++17 +using std::cin; +using std::cout; +using std::endl; using namespace cv; /** diff --git a/samples/cpp/tutorial_code/ImgProc/changing_contrast_brightness_image/changing_contrast_brightness_image.cpp b/samples/cpp/tutorial_code/ImgProc/changing_contrast_brightness_image/changing_contrast_brightness_image.cpp index 7ee22a2258..a7dff6e92b 100644 --- a/samples/cpp/tutorial_code/ImgProc/changing_contrast_brightness_image/changing_contrast_brightness_image.cpp +++ b/samples/cpp/tutorial_code/ImgProc/changing_contrast_brightness_image/changing_contrast_brightness_image.cpp @@ -2,7 +2,7 @@ #include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" -using namespace std; +// we're NOT "using namespace std;" here, to avoid collisions between the beta variable and std::beta in c++17 using namespace cv; namespace diff --git a/samples/cpp/tutorial_code/core/AddingImages/AddingImages.cpp b/samples/cpp/tutorial_code/core/AddingImages/AddingImages.cpp index 1dd1d09546..1181894482 100644 --- a/samples/cpp/tutorial_code/core/AddingImages/AddingImages.cpp +++ b/samples/cpp/tutorial_code/core/AddingImages/AddingImages.cpp @@ -8,7 +8,11 @@ #include using namespace cv; -using namespace std; + +// we're NOT "using namespace std;" here, to avoid collisions between the beta variable and std::beta in c++17 +using std::cin; +using std::cout; +using std::endl; /** * @function main diff --git a/samples/cpp/tutorial_code/photo/seamless_cloning/cloning_gui.cpp b/samples/cpp/tutorial_code/photo/seamless_cloning/cloning_gui.cpp index 8e9e23fb5c..1bde7ee5e4 100644 --- a/samples/cpp/tutorial_code/photo/seamless_cloning/cloning_gui.cpp +++ b/samples/cpp/tutorial_code/photo/seamless_cloning/cloning_gui.cpp @@ -38,7 +38,12 @@ #include #include -using namespace std; +// we're NOT "using namespace std;" here, to avoid collisions between the beta variable and std::beta in c++17 +using std::cin; +using std::cout; +using std::endl; +using std::string; + using namespace cv; Mat img0, img1, img2, res, res1, final, final1, blend;