【发布时间】:2017-07-01 01:02:49
【问题描述】:
按照 Java 中的 Disruptor 教程,他们进行了以下调用
Disruptor<LongEvent> disruptor = new Disruptor<>(LongEvent::new, bufferSize, executor);
LongEvent 是使用无参数的默认构造函数实例化的,即。 new LongEvent().
Kotlin 中的等效行在 ::new 处引发错误。 Kotlin 中::new 的正确语法是什么?
# THIS IS INVALID
val disruptor = Disruptor<LongEvent>(LongEvent::new, bufferSize, executor)
【问题讨论】: