Storing interfaces as void[]

tsbockman thomas.bockman at gmail.com
Fri Mar 12 18:54:20 UTC 2021


On Friday, 12 March 2021 at 18:50:26 UTC, tsbockman wrote:
>     /* This will return `null` if the value isn't really a 
> reference to an instance
>     of a subtype of `I`, or if the key isn't in the map yet. If 
> you don't care
>     about the latter case, it can be shortened to just `cast(I) 
> map[I.stringof]`. */

Oops, that last bit should say `cast(I) map[typeid(I)]`.


More information about the Digitalmars-d-learn mailing list