[OpenCV 2.2] using namespace std; in the .h body !! (Bug #846)
Description
Hi,
There is a mistake in opencv 2.2, very tedious when working on big projects with many dependencies:
In the "opencv2/flann/" module, there are several files containing a using namespace std in the common body of the .h. This implies that when including cv.h, we get conflicts with other types.
I recommand to put the "using namespace std" inside the cv namespace. This doesn't implies any changes for you but a lot for people using OpenCV.
Example:
h30. ORIGINAL
#ifndef OPENCV_RESULTSET_H
#define OPENCV_RESULTSET_H
#include <algorithm>
#include <limits>
#include <vector>
#include "opencv2/flann/dist.h"
using namespace std;
namespace cvflann
{
[...]
h30. FIXED
#ifndef OPENCV_RESULTSET_H
#define OPENCV_RESULTSET_H
#include <algorithm>
#include <limits>
#include <vector>
#include "opencv2/flann/dist.h"
namespace cvflann {
using namespace std;
[...]
Thank you in advance,
Eloi du Bois.
History
Updated by Dmitry Bely about 14 years ago
I have also run into that. Really a showstopper.
Updated by Marius Muja about 14 years ago
Fixed in r4727.
- Status changed from Open to Done
- (deleted custom field) set to fixed