Unrelated question: is there a way to forward argu...
# announcements
n
Unrelated question: is there a way to forward arguments generically to another function in kotlin?
s
You mean currying?
n
Not really no
Like as an example, suppose I have a class that wraps a DataClass
I went to expose the copy function outward
*want
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);
k
No, there's nothing like that in Kotlin.
n
Unfortunate, it solves a real problem
k
There's this feature request: https://youtrack.jetbrains.com/issue/KT-15471
n
It's simlar but you'd still have the boilerplate of declaring the dataclass it seems like
I just want a pure forwarding mechanism