Unrelated question: is there a way to forward argu...
# announcements
Unrelated question: is there a way to forward arguments generically to another function in kotlin?
You mean currying?
Not really no
Like as an example, suppose I have a class that wraps a DataClass
I went to expose the copy function outward
but that would mean repeating its signature
which is a significant amount of boilerplate
I want to be able to write a member function whose signature basically says: i don't care what typse you give me, I accept anything, but whatever you give me I'll just forward to copy
If you're familiar with C++ you can do
template <class ... Ts> void foo(Ts&& ts);
No, there's nothing like that in Kotlin.
Unfortunate, it solves a real problem
There's this feature request: https://youtrack.jetbrains.com/issue/KT-15471
It's simlar but you'd still have the boilerplate of declaring the dataclass it seems like
I just want a pure forwarding mechanism