Re: Error: castSwitch

2016-06-07 Thread Marc Schütz via Digitalmars-d-learn
On Tuesday, 7 June 2016 at 03:55:03 UTC, none wrote: import std.algorithm.iteration : map; import std.algorithm : castSwitch; import std.format : format; class A { int value; this(int value) { this.value = value; }} interface I { } class B : I { } Object[] arr = [new A(5), new

Error: castSwitch

2016-06-06 Thread none via Digitalmars-d-learn
import std.algorithm.iteration : map; import std.algorithm : castSwitch; import std.format : format; class A { int value; this(int value) { this.value = value; }} interface I { } class B : I { } Object[] arr = [new A(5), new B(), null]; auto results = arr.map!(castSwitch!(