June 06, 2021 General » Re: Stop using the enum as a manifest constant. | |||
|---|---|---|---|
| |||
...return "hello".dup; }
immutable DEFAULT = foo();
void bar(char[] data = DEFAULT.dup) {
data[0] = '1... | |||
June 06, 2021 General » Re: Stop using the enum as a manifest constant. | |||
|---|---|---|---|
| |||
...enum WAT = foo();
void main() @safe {
bar();
}
void bar(int[] data = WAT) @safe
{
data[0... | |||
June 06, 2021 General » Re: Stop using the enum as a manifest constant. | |||
|---|---|---|---|
| |||
...the following:
```D
enum DEFAULT = foo();
char[] foo () { return null; }
void bar (char[] arg = DEFAULT);
``` | |||
June 02, 2021 Issues » [Issue 18827] scope delegate literal allocates GC closure | |||
|---|---|---|---|
| |||
...dg)
{
global = dg;
return dg(2);
}
void bar()
{
int a = 3;
scope dg = (int x... | |||
May 29, 2021 Learn » Re: Cast class reference to pointer of another class? | |||
|---|---|---|---|
| |||
...d
struct Foo
{
}
class Bar
{
}
void main()
{
Bar b = new Bar();
Foo* f = cast(Foo... | |||
May 29, 2021 Learn » Cast class reference to pointer of another class? | |||
|---|---|---|---|
| |||
```struct Foo
{
}
class Bar
{
}
void main()
{
Bar b = new Bar();
Foo* f = cast(Foo*)b... | |||
May 28, 2021 Issues » [Issue 11255] Support for inner unittests | |||
|---|---|---|---|
| |||
...tricks, from outside, like this:
```d
int bar(int a) {
static int d;
static int... | |||
May 25, 2021 Announce » Re: From the D Blog -- Interfacing D with C: Strings Part One | |||
|---|---|---|---|
| |||
...in side bar is visible, but they are not clickable. The progress bar is still... | |||
May 20, 2021 General » Behavior of std.conv : to with alias this | |||
|---|---|---|---|
| |||
...struct Bar {
int s = 3;
alias s this;
T opCast(T)() { return 43; }
}
Bar().to... | |||
May 18, 2021 General » Re: Associative arrays | |||
|---|---|---|---|
| |||
...AAs
aa["foo"]["bar"] = true; // assigns both aa["foo"] and aa["foo"]["bar"]
With a... | |||
Copyright © 1999-2021 by the D Language Foundation