August 30 DIP Ideas » Re: Allow designated initialization of struct | |||
|---|---|---|---|
| |||
...c;
}
void my_fun(Data data) {}
void main()
{
my_fun( Data (c: 1 ) );
}
```
I tried... | |||
August 30 General » Re: Disallowing S() when struct S has a constructor | |||
|---|---|---|---|
| |||
...behaves like `S()`, not `S.init`:
void main()
{
int n;
struct S
{
void fun() { ++n... | |||
August 30 General » Re: interpolation proposals and safety | |||
|---|---|---|---|
| |||
...this (string s)
{
this.s = s;
}
}
void main ()
{
auto c = new C ("<script>alert(-1... | |||
August 30 Issues » [Issue 24731] New: IFTI cannot handle integer expressions | |||
|---|---|---|---|
| |||
...N)(ref double[N+1][N]) {}
void main()
{
double[3][2] m;
solve!2(m... | |||
August 29 General » Disallowing S() when struct S has a constructor | |||
|---|---|---|---|
| |||
...struct S
{
this(int[]...) { writeln("ctor"); }
}
void main()
{
S s;
s = S(); // huh, no ctor... | |||
August 29 DIP Ideas » Allow default constructors for structs | |||
|---|---|---|---|
| |||
...struct S {
this() {
writeln("S.this()");
}
}
void main {
S s; // error
S t = S(); // ok... | |||
August 29 General » Re: interpolation proposals and safety | |||
|---|---|---|---|
| |||
...UserString
{
string unwrap;
@disable string toString();
}
void main() {
auto name = UserString("<script>alert(-1)</script... | |||
August 29 General » Re: Tell us your DIP1000 woes | |||
|---|---|---|---|
| |||
...length, wrong value ext.):
```d
@safe:
void main() {
int*[1] value;
int** ptr = &value[0... | |||
August 28 Issues » [Issue 24730] New: Cannot initialize ref variable through `alias this` | |||
|---|---|---|---|
| |||
...S2
{
S s;
alias this = s;
}
void main()
{
S2 s2;
ref S s = s2;
}
a... | |||
August 28 General » Re: This needs to be fixed | |||
|---|---|---|---|
| |||
...S
{
int x;
mixin S2!"inner";
}
void main()
{
S s = S(42);
s.inner.foo();
}
```
| |||
Copyright © 1999-2021 by the D Language Foundation