Ambiguity, including std class libraries

I have Visual Studio 2005. One of my header files has an enumeration of type

typedef enum {scalar, array, set} increment;

When I try to include the header file, I get an ambiguity error for "set". I am using std :: set in this cpp file. The problem is that the compiler cannot distinguish between std :: set and the set in the enumeration.

Any suggestions for resolving this ambiguity without declaring any new namespace

+3
source share
4 answers

std . STL std, , using namespace std, . , .

+6

using namespace std; ( , ), .

+1

enum - "e"

enum E_increment {eScalar, eArray, eSet}

0

++ . , Qt enum GestureType. TapGesture PanGesture, "Tap" "Pan". :

enum increment { scalar_increment, array_increment, set_increment };

In the next version of C ++, the correct solution will appear in the form of strong enums .

-1
source

Source: https://habr.com/ru/post/1732817/


All Articles