On Friday, 2 August 2013 at 00:44:21 UTC, Meta wrote:
One more way, not necessarily a workaround but a little trick that doesn't require you to know the exact type of box, is to use typeof(box).auto box = Box!int(); auto item = cast(Item)box; auto box2 = cast(typeof(box));
Whoops, make that last line: auto box2 = cast(typeof(box))item;