Best way to convert an boolean to an enum?

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?
What do you mean?
Boolean and enum are two completely different types. You should not attempt to do that.
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.
So does say
ENUMNAME = statistic_cast<ENUMNAME> (function() )

work?
Topic archived. No new replies allowed.