June 24, 2022 Issues » [Issue 23211] New: is(__traits(parent,...) == module) evaluates to false even if the parent is module | |||
|---|---|---|---|
| |||
...a;
static assert(is(a == module)); // ok
alias m = __traits(parent, {}); static assert(is(m... | |||
June 22, 2022 Learn » Re: nested function overloading | |||
|---|---|---|---|
| |||
...don't even need to use the alias.
```d
void main(){
template bar(){
void bar... | |||
June 22, 2022 Learn » Re: nested function overloading | |||
|---|---|---|---|
| |||
...bar(){
void bar_(int){}
void bar_(float){}
alias bar=bar_;
}
bar(1);
bar(3.14);
}
``` | |||
June 21, 2022 Learn » Re: Better way to achieve the following | |||
|---|---|---|---|
| |||
Maybe check out `std.meta.Alias`? https://dlang.org/phobos/std_meta.html#.Alias | |||
June 21, 2022 Learn » Better way to achieve the following | |||
|---|---|---|---|
| |||
...alias shortName = theFirstName[theFirstIndex].theSecondName[theSecondIndex].thirdName[theThirdIndex]; shortName = x; ``` but you can't alias... | |||
June 21, 2022 General » Re: Template wizardry and its cost | |||
|---|---|---|---|
| |||
...string _str;
string get()
{
return gettext(_str);
}
alias get this;
}
private @safe struct Strplusarg {
this... | |||
June 20, 2022 General » Re: Template wizardry and its cost | |||
|---|---|---|---|
| |||
...string _str;
string get()
{
return gettext(_str);
}
alias get this;
}
private @safe struct TranslatableStringPlural
{
string... | |||
June 20, 2022 General » Re: Template wizardry and its cost | |||
|---|---|---|---|
| |||
...str;
string get() {
return curLang.translate(_str);
}
alias get this;
}
template gettext(string str) {
version... | |||
June 19, 2022 General » Re: Bug of the sqrt() compiled by DMD | |||
|---|---|---|---|
| |||
...fixed. Please try and see with your own eyes: ```d alias integer = long; ``` SDB@79 | |||
June 19, 2022 General » Bug of the sqrt() compiled by DMD | |||
|---|---|---|---|
| |||
...numbers.
```d
import std.math, std.stdio;
alias integer = ulong;
void main()
{
integer n = 94... | |||
Copyright © 1999-2021 by the D Language Foundation