The exact warning I get is
warning C4715: \'hand::show\' : not all control paths return a value
and hand::show is
std::ostr
If side is not left or right, then the return value is undefined.
Even though orientation is an enum with only two values (right now), it can still have a different value for any of the following reasons:
side might be uninitialized, so it could be neither left nor rightside might have been assigned another value via typecasting, e.g. *((int*)&side) = 2 Possible solutions include:
if with an else as suggested by sth.Change it to be:
if(side == left) {
return ...;
} else if(side == right) {
return ...;
} else {
...handle error...
}