January 23, 2023 General » Re: Typical security issues in C++: why the GC isn't your enemy | |||
|---|---|---|---|
| |||
...fghn(param1, param2);
// more safe stuff
}
@trusted fghn(p1, p2)
{
assert(...);
assert(...);
systemFunc(p1, p2);
}
```
| |||
January 23, 2023 Learn » Re: How to use @safe when a C library integration needed | |||
|---|---|---|---|
| |||
...used correct
@assert(/*C_Fun is safe to be used with param1*/);
@assert(/*C_Fun... | |||
January 23, 2023 General » Re: Typical security issues in C++: why the GC isn't your enemy | |||
|---|---|---|---|
| |||
...safe stuff
@trusted {
@assert(/*systemFunc is safe to be used with param1*/);
@assert(/*systemFunc is... | |||
January 23, 2023 Issues » [Issue 23650] New: Using typeid with struct defined in in __traits(compiles, ...) causes linker error | |||
|---|---|---|---|
| |||
...initZ'
---
__gshared int x;
void main()
{
static assert(__traits(compiles,
{
struct S { int *p = &x... | |||
January 23, 2023 Learn » Re: Function which returns a sorted array without duplicates | |||
|---|---|---|---|
| |||
...8]; auto sorted = nums.sortArray; assert(sorted.equal(nums.sortArrayy)); assert(sorted.equal(nums.sortArrayyy... | |||
January 22, 2023 Learn » Re: Is there a way to get a template’s parameters and constraints? | |||
|---|---|---|---|
| |||
...defaultValue;
}
public auto templateParameters(alias T)()
{
static assert(__traits(isTemplate, T));
import std.algorithm : startsWith... | |||
January 21, 2023 Issues » [Issue 18146] A case expression of final switch allows to pass wrong enum value | |||
|---|---|---|---|
| |||
...assert(N == 2u); // compile-time error is generated here
break;
case BezierOrder.Quadratic:
static assert... | |||
January 19, 2023 Learn » Re: What is the 'Result' type even for? | |||
|---|---|---|---|
| |||
...const expected = [ 42, 7, 42, 7, 42 ];
assert(myRange.take(5).equal(expected));
}
> even when... | |||
January 20, 2023 Learn » Re: What is the 'Result' type even for? | |||
|---|---|---|---|
| |||
...splitter("|").chain(["f"]);
string[] e = ["a", "b", "c", "d", "e", "f"];
assert(c.equal(e));
}
``` | |||
January 19, 2023 Learn » Re: What is the 'Result' type even for? | |||
|---|---|---|---|
| |||
...a|b|c|d|e".split('|');
static assert(is(typeof(c) == string[]));
// or:
auto c2... | |||
Copyright © 1999-2021 by the D Language Foundation