Java Generics and C Templates
843793Dec 23 2003 — edited Dec 29 2003I'm familiar with Java generics and I think I read the way those are implemented is different from C Templates beause C templates generate much more code.
I know I could answer my own question by reading a few white papers and grabbing some books, but all I want a quick answer to these questions:
1) When you instantiate a C template you generate the binary code equivalent to implementing the generic code in the particular type, so there binary code repetition, right?
2) For every generic java class you get 1 binary (bytecode), right?
So how exactly does the gjava compiler deal with the diferent casts needed if you instantiate a list of trees or a list of persons without repeating code?
I may be a bit lost in the implementation details, but feel free to be technical if you want.
When I say gjava I mean the java + generics that is going to be released soon not GJava.