On Tuesday, 11 February 2014 at 17:09:39 UTC, Stanislav Blinov wrote: > ref auto assumeLocal(T)(ref T v) if (is(T == shared)) > { > // Cast via pointer to preserve lvalue > return *cast(HeadUnshared!T*)&v; > } Well, maybe not HeadUnshared!T but some other template that removes shared qualifier.