Hi, is there a way to have data classes being proj...
# kotlin-native
a
Hi, is there a way to have data classes being projected better as a C struct without a function pointer for each member to access its data?
1
🤔 1
r
Why? To optimize the code?
a
The shared code I have is in Kotlin Multiplatform / Kotlin Native. The UI is not shared though because the platforms are a lot different. But I still want to have shared models so that the UI on each platform can just consume them. Unfortunately, on the linux platform where the UI is in C/C++ it's not possible to access straight models because data classes are translated into structs and each member is replaced with a function pointer. This makes everything extremely verbose compared to just my_struct->my_member.
r
OK, I see. Thanks for the clarification. I do not have an answer. Good question!
👍 1