CNI array syntax
Tom Tromey
tromey@redhat.com
Tue Apr 3 10:39:00 GMT 2001
>>>>> "Bryce" == Bryce McKinlay <bryce@albatross.co.nz> writes:
Bryce> Has a more natural syntax for creating java arrays from CNI
Bryce> ever been considered?
I haven't. I don't think there's been a whole lot of thought about
how to evolve CNI.
Bryce> Today I wanted to do the equivilant of "new java.io.File[1]" in
Bryce> C++. The code for this (afaik) is quite ugly:
Bryce> myfile = reinterpret_cast <JArray< ::java::io::File *>*>
Bryce> (JvNewObjectArray (1, &java::io::File::class,ドル f));
Bryce> But it should be able to be much more cleanly expressed as:
Bryce> myfile = new JArray<java::io::File *> (1);
Could you do this by adding `operator new' to JArray? Maybe that
could encapsulate the ugliness without requiring a hack to g++.
Tom
More information about the Java
mailing list