Best way to convert an boolean to an enum?

Sep 18, 2016 at 10:14pm
I have a boolean function, but I have an enum that acts as an boolean with two values. What is the cleanest way to convert the return boolean value to the enum?
Sep 18, 2016 at 10:30pm
What do you mean?
Boolean and enum are two completely different types. You should not attempt to do that.
Sep 18, 2016 at 11:04pm
Well I wanted to avoid unused variable warning, but not have to use dummy code to put it there. The enum and boolean are used essentially for the same thing, but the return value of the boolean is from a non-modifiable function. If so I would have changed it to an enum instead of a boolean.
Sep 19, 2016 at 12:48am
So does say
ENUMNAME = statistic_cast<ENUMNAME> (function() )

work?
Topic archived. No new replies allowed.