BCS wrote: > // overlay array with new struct array and sort that > (cast(FooWrap*)f.ptr)[0..f.length].sort That probably looks better as "(cast(FooWrap[]) f).sort", which should be equivalent.