I have Visual studio 2005 . One of my header file has a enum like
typedef enum { scalar, array, set } increment;
When I try to include the header file I get an ambiguity error for “set”.
I am using the std::set in this cpp file . The issue is the compiler is unable to differentiate between the std::set and the set in the enum .
Any suggestions to resolve this ambiguity without declaring any new namespace
Don’t import the std namespace into the global namespace. The STL set is in the std namespace so if you don’t have the line
using namespace stdin your headers you shouldn’t get a conflict. Beyond that, refactor your enum.