For all marketing, Sun Java is not just the best C ++, but actually does not support many of the idioms and paradigms supported by C ++. This makes automatic translation difficult. How should you automatically turn a multi-legacy hierarchy into a Java single inheritance hierarchy? (Note, I'm not saying that a hierarchy with multiple heirs is good, just that it is explicitly allowed in C ++). More fundamentally, how would you represent a member function of a member in Java? Or handle the differences between Java overload resolution and C ++?
Java added generics several years ago, but specifically made them less powerful than C ++ templates. Regardless of whether this was a good idea, it limits what automatic translation can do with heavily shaded code.
Besides using some research compiler that can turn C ++ into Java bytecode, I'm afraid you might be stuck with manual porting.
Max lybbert
source share