Code:
class Object {
public:
enum STYLE { SOLID = 0, NUL, HATCHED, PATTERN };
enum HATCH { HORIZONTAL = 0, VERTICAL, FDIAGONAL, BDIAGONAL, CROSS, DIAGCROSS };
bool MakeHatched( HATCH style ) {
//...
}
};
int main() {
Object b;
//...OK...
b.MakeHatched( Object::VERTICAL );
//...nope, compiler rejects, needs a HATCH, cool...
b.MakeHatched(Object::SOLID);
//... no matching call to MakeHatched(int);
//...canidates are MakeHatched(HATCH);
b.MakeHatched( 1 ); //...damn. I want to be able to use an int!
}
So is there any way to force it to accept both? Because when I make a wrapper for the int, it accepts this:
Code:
//...This compiles! No good!! Must be a HATCH!
b.MakeHatched(Object::SOLID);