Emulating variadic templates in Scala

前端 未结 1 674
鱼传尺愫
鱼传尺愫 2021-02-14 07:49

Suppose you want to have something like variadic templates (the ability to define n type parameters for a generic class) in Scala.

For example you do not want to define

相关标签:
1条回答
  • 2021-02-14 08:19

    At the moment there's no syntactical construct in Scala which allows what you're suggesting. That's also the reason why there are 22 Tuple classes (Tuple2, Tuple3, ..., Tuple22) and also different Function classes (Function0, ...).

    0 讨论(0)
提交回复
热议问题