std.algorithm.joiner (string [], string) - dlaczego elementy wynikowe są dchar i nie char?
Próbuję skompilować następujący kod:
import std.algorithm;
void main()
{
string[] x = ["ab", "cd", "ef"]; // 'string' is same as 'immutable(char)[]'
string space = " ";
char z = joiner( x, space ).front(); // error
}
Kompilacja zdmd
kończy się błędem:
test.d(8): Error: cannot implicitly convert expression (joiner(x,space).front()) of type dchar to char
Wymiana pieniędzychar z
dodchar z
naprawia komunikat o błędzie, ale interesuje mnie, dlaczego pojawia się w pierwszej kolejności.
Dlaczego wynikjoiner(string[],string).front()
jest dchar, a nie char?
(W dokumentacji nie ma nic na ten temathttp://dlang.org/phobos/std_algorithm.html#joiner)