On Saturday, 9 April 2016 at 08:59:13 UTC, ag0aep6g wrote:
On 09.04.2016 10:45, alexander Patapoff wrote:
[...]

There is a somewhat obscure feature which lets you declare and instantiate a class at the same time:

----
interface Action
{
  void actions(int x);
}

void main()
{
  Action action = new class Action {
      void actions(int x) {/* ... */}
  };
}
----

http://dlang.org/spec/class.html#anonymous

Yaaay! thank you!
  • Interfaces alexander Patapoff via Digitalmars-d-learn
    • Re: Interfaces ag0aep6g via Digitalmars-d-learn
      • Re: Interfaces alexander Patapoff via Digitalmars-d-learn

Reply via email to