A little question: is it possible to overload an o...
# random
x
A little question: is it possible to overload an operator with a class property ? My use case is an enum representing “commands”, which I want to make invocable. So far, I have something like that:
Copy code
enum class Operation(private val action: (Int) -> Int) {
  INC({ it + 1 }),
  DEC({ it - 1 });

  operator fun invoke(i: Int): Int = action(i)
}