On Sunday, 8 January 2023 at 09:45:09 UTC, Krzysztof Jajeśnica wrote:
## Simple explanation

`to!string` is a function expecting 1 argument, which you're not providing in your alias. Convert your alias to a lambda expression:

```D
alias comb = x => x.to!string.map!q{a - '0'}
```

A logical solution...

Since your goal is to manipulate numbers, it is possible to convert directly to char type:

```d
import std.algorithm : map, sum;
import std.conv : toChars;

alias comb = (uint x) => x.toChars.map!"a - '0'";
void main()
{
    auto s = 2234.comb.sum;
    assert(s.comb.sum == 2);
}
```

SDB@79

Reply via email to