Search

June 26, 2023
Issues »
...is a multi-line
        heredoc string
        EOS";
    assert(str == "This\nis a multi-line\nheredoc...
June 23, 2023
Learn »
```
static assert(__traits(isPOD, int)); // ok.
static assert(__traits(isPOD, byte)); // ok.
```
It's a...
June 23, 2023
Learn »
...writeln("` ~ VarName ~ ` ", " is an int");` ~
      `} else {` ~
         `static assert(false, "mxnTst Variable '` ~ VarName  ~ `' is of unknown...
June 22, 2023
Issues »
...n");
        i = 1;
    }
    printf("%d\n", i);
    assert(i == 4);
}
```

The assertion fails.
Looking at...
June 21, 2023
General »
...0 1 2 3 4 5 6
    [ ]
      [ ]
        [ ]
          [ ]
            [ ]
              [ ]
    */
    assert(x.equal!equal(
        [[0, 1],
         [1, 2...
June 20, 2023
Learn »
...int[](100);
assert(a.length == 100);

or

int[] a;
a.length = 100;
assert(a.length...
June 20, 2023
Issues »
...∧ Q } assert(P) { Q }
{ Q } assume(P) { P ∧ Q }

In D, `assert` is...
June 20, 2023
Issues »
...assumption. They both mean the same thing.

assert():
- code following is optimized with the assumption...
June 20, 2023
Issues »
...assert might be used to validate function input, e.g. `isPrime(int x)` might
`assert...
June 20, 2023
Issues »
...in the type:
```d
auto f() {}
static assert(is(typeof(&f) == void function() @safe nothrow...
69 70 71 72 73 74 75 76 77 78 79 80
Next ›   Last »