[Issue 16263] Error: template std.algorithm.iteration.permutations cannot deduce function from argument types !()(char[])

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Jul 15 11:12:21 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=16263

--- Comment #10 from ag0aep6g at gmail.com ---
(In reply to Wyatt from comment #8)
> I'm afraid I disagree: things not behaving as documented is always a bug.

As far as I see, everything works as documented. Please point out where it
doesn't.

permutations has as a constraint: isRandomAccessRange!Range [1]. In the
documentation for isRandomAccessRange we  read: "Although char[] and wchar[]
(as well as their qualified versions including string and wstring) are arrays,
isRandomAccessRange yields false for them because they use variable-length
encodings (UTF-8 and UTF-16 respectively). These types are bidirectional ranges
only." [2]


[1] https://dlang.org/phobos/std_algorithm_iteration.html#.permutations
[2] https://dlang.org/phobos/std_range_primitives.html#.isRandomAccessRange

--


More information about the Digitalmars-d-bugs mailing list