On Sat, Feb 07, 2015 at 06:19:19PM -0800, Andrei Alexandrescu via Digitalmars-d 
wrote:
[...]
> private @system T[] mallocUninitializedArrayImpl(T)(size_t n)
> {
>     auto p = malloc(n * T.sizeof);
>     p || assert(0, "Not enough memory");

This is a truly strange way of writing it... why not:

        assert(p !is null, "Not enough memory");

?


>     return (cast(T*) p)[0 .. n];
> }


T

-- 
Tell me and I forget. Teach me and I remember. Involve me and I understand. -- 
Benjamin Franklin

Reply via email to