On Wednesday, 30 July 2014 at 18:25:43 UTC, H. S. Teoh via Digitalmars-d wrote:
If you want the check to always be there, use enforce, not assert.

Doesn't help:

    module a;
    void bar(int x) {
        assert(x > 0);
        writeln("x = ", x);
    }
    // --------
    module b;
    import a;
    void foo(int x) {
        enforce(x > 0);
        bar(x);
    }

If `assert` is treated like `assume` (under Ola's definitions), then `enforce` can be optimized away.

Reply via email to