How about
Code:
value::value1 val = (value::value1) obj;
or, for example, if you have function like
void foo(
value::value1 v), you can use the
conversion function
Code:
foo((value::value1) obj);
You don't even have to use the explicit typecast as long as there is no ambiguity.
Oh, and the operator should probably return something.