does kotlin native support primitive (int, long, f...
# kotlin-native
m
does kotlin native support primitive (int, long, float...) arraylists without boxing?
t
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int-array/index.html says that native it supported though I don't know about boxing
m
@thevery IntArray is supported in KN but it is not ArrayList (it does not automatically increase its size when full)
d
It would have to use a different version of ArrayList automatically I think, like C# runtime.
Is vector from cstdlib available?
l
@Matej Kormuth IntArray is considered equivalent with Java’s Int[] or int32_t[] in cpp, it will not auto increase size. While ArrayList is generic which is implemented with Type-Erasure, all Element type is treated as Any at runtime, so primitive in ArrayList(and other collections) must do auto box for putting into, which differs from what C++ template does.
o
IntArray, LongArray and so on are cross-platform, and supported on JVM, Native and JS