March 24, 2023 General » Re: Does `is` expression with template alias need fixing. | |||
|---|---|---|---|
| |||
...alias is not itself a type! So in the case where `A` is an alias... | |||
March 23, 2023 Learn » Re: Implicit type conversion depending on assignment | |||
|---|---|---|---|
| |||
...want types other than string as well. > alias toString this; That should have been a... | |||
March 23, 2023 Learn » Re: Implicit type conversion depending on assignment | |||
|---|---|---|---|
| |||
...T(value) + rhs;
else
static assert(0);
}
alias opBinary this;
}
void main()
{
auto a = MyVal... | |||
March 23, 2023 Learn » Re: Implicit type conversion depending on assignment | |||
|---|---|---|---|
| |||
...implicit conversions. There is some support like 'alias this' as you mentioned but what you... | |||
March 23, 2023 Learn » Re: Implicit type conversion depending on assignment | |||
|---|---|---|---|
| |||
...auto toString(T)()
{
return value.to!T;
}
alias toString this;
}
auto a = MyVal("100");
auto... | |||
March 23, 2023 Learn » Re: Implicit type conversion depending on assignment | |||
|---|---|---|---|
| |||
...different, the struct with "alias this" is a redefinition of the "alias this"'ed thing... | |||
March 23, 2023 Learn » Re: Implicit type conversion depending on assignment | |||
|---|---|---|---|
| |||
...different, the struct with alias this a redefinition of the "alias this"'ed thing, that... | |||
March 23, 2023 Learn » Re: Implicit type conversion depending on assignment | |||
|---|---|---|---|
| |||
...documentation](https://dlang.org/spec/struct.html#alias-this), but for "several" types, for example... | |||
March 23, 2023 Learn » Implicit type conversion depending on assignment | |||
|---|---|---|---|
| |||
...it would be possible to use an alias to this, but it can only be... | |||
March 23, 2023 General » Re: Does `is` expression with template alias need fixing. | |||
|---|---|---|---|
| |||
...using the alias template in the parameter list:
```
struct B (T, V) { }
alias A (T... | |||
Copyright © 1999-2021 by the D Language Foundation