auto s = 1234.to!string.map!q{a - '0'}.sum;
works fine.
but if i do an alias
alias comb = to!string.map!q{a - '0'}
Error: unknown, please file report on issues.dlang.org
What's wrong with this alias?
Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
January 08, 2023 what wrong with this alias | ||||
---|---|---|---|---|
| ||||
works fine. but if i do an alias
What's wrong with this alias? |
January 08, 2023 Re: what wrong with this alias | ||||
---|---|---|---|---|
| ||||
Posted in reply to Qusatlegadus | On Sunday, 8 January 2023 at 05:42:46 UTC, Qusatlegadus wrote: >What's wrong with this alias?
SDB@79 |
January 08, 2023 Re: what wrong with this alias | ||||
---|---|---|---|---|
| ||||
Posted in reply to Qusatlegadus | On Sunday, 8 January 2023 at 05:42:46 UTC, Qusatlegadus wrote: >
works fine. but if i do an alias
What's wrong with this Simple explanation
Complicated explanation
Basically what happens is you're trying to pass an uninstantiated template as argument to |
January 08, 2023 Re: what wrong with this alias | ||||
---|---|---|---|---|
| ||||
Posted in reply to Krzysztof Jajeśnica | On Sunday, 8 January 2023 at 09:45:09 UTC, Krzysztof Jajeśnica wrote: >Simple explanation
A logical solution... Since your goal is to manipulate numbers, it is possible to convert directly to char type:
SDB@79 |
January 09, 2023 Re: what wrong with this alias | ||||
---|---|---|---|---|
| ||||
Posted in reply to Qusatlegadus | On 1/8/23 12:42 AM, Qusatlegadus wrote: > auto s = 1234.to!string.map!q{a - '0'}.sum; but if i do an alias alias comb = to!string.map!q{a - '0'} Error: unknown, please file report on issues.dlang.org What's wrong with this alias? Aside from the problem with the code, that error alone deserves a bug report so... https://issues.dlang.org/show_bug.cgi?id=23615 -Steve |