Hi,
I'd like to use a binary heap from @safe code. I thought @safe is transitive but the following example does not compile:

import std.container.binaryheap;
@safe // This makes things fail.
unittest
{
        // Test range interface.
        import std.algorithm.comparison : equal;
        int[] a = [4, 1, 3, 2, 16, 9, 10, 14, 8, 7];
        auto h = heapify(a);
        assert(h.equal([16, 14, 10, 9, 8, 7, 4, 3, 2, 1]));
}

Is there a way to @safely call heapify? How?

Thanks in advance!

Reply via email to