Newsgroup: comp.lang.c++
Subject: scoped enum issue with MS VS C++
From: bobl0456@...
Date: Mon, 21 Oct 2013 11:37:06 -0700 (PDT)
I get the following error:
TurtleGraphics.cpp(93): error C2677: binary '!=' : no global operator found which takes type 'Cmds' (or there is no acceptable conversion)
for the following statement:
} while ( cmdsArray[cmdNo] != Cmds::END_OF_DATA ); // repeat until end of data reached
Cmds is defined as:
enum class Cmds { PEN_UP = 1, PEN_DWN, TURN_RIGHT, TURN_LEFT, MOVE, DISPLAY, END_OF_DATA = 9};
and cmdsArray is a pointer based array of type int.
I do not understand why this should not work. BTW, I know that if I change the enum back to traditional unscoped enum it will work fine.
Bob
Subject: scoped enum issue with MS VS C++
From: bobl0456@...
Date: Mon, 21 Oct 2013 11:37:06 -0700 (PDT)
I get the following error:
TurtleGraphics.cpp(93): error C2677: binary '!=' : no global operator found which takes type 'Cmds' (or there is no acceptable conversion)
for the following statement:
} while ( cmdsArray[cmdNo] != Cmds::END_OF_DATA ); // repeat until end of data reached
Cmds is defined as:
enum class Cmds { PEN_UP = 1, PEN_DWN, TURN_RIGHT, TURN_LEFT, MOVE, DISPLAY, END_OF_DATA = 9};
and cmdsArray is a pointer based array of type int.
I do not understand why this should not work. BTW, I know that if I change the enum back to traditional unscoped enum it will work fine.
Bob
via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?112677-scoped-enum-issue-with-MS-VS-C&goto=newpost
View all the progranning help forums at:
http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums
No comments:
Post a Comment