I'm using the BOOST_ENUM
macro and trying to write a switch statement based on a variable of the enum type I created. I get the error message that "expression must have integral or enum type"
Is there any way to use Boost enums and switch statements together?
I've seen This link, but it says to use boost::native_value
, and I get the message that the Boost namespace has no native_value member. I couldn't figure out if I'm supposed to be including an extra header files for it.
Any ideas?
Example code:
BOOST_ENUM(Direction,
(Forward)
(Backward)
)
Direction response = Direction::Forward;
switch (response)
{
case Direction::Forward :
return;
break;