This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: eliminate gcjh?


Per> One important question: can we map Java generic classes into C++
Per> generic classes in gcjh?  How should we handle generic classes
Per> in gcjh?

I suspect we should just ignore the genericity.  Java generics don't
really work like C++ templates.  In C++ you instantiate the template
for each set of parameters.  In Java you emit a single implementation
for a template by doing erasure on the parameterized types.  So for
instance in my earlier message, something like `class Base<T>' emerges
from code generation as (basically) `class Base<Object>'.

There's a lot here I don't know, however.  For instance, I don't know
what reflection returns when you ask about parameterized types.
Perhaps it just returns the raw type.

Other factors are our goals for CNI and what the g++ maintainers will
let us put into g++.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]