void main() { char[] thing; import std.algorithm.mutation: fill; fill(thing,cast(char)'Q'); } // Error: template std.algorithm.mutation.fill cannot deduce function from argument types !()(char[], char)
front(char[]) is not assignable, it's not a reference. If you look at the contraint, "range.front = value" must be compilable. front(char[]) is not assignable because it decodes an undetermined amount of bytes. That said there's no valid reason to disallow to fill with a char since it can fill exactly array.length times the array.
Was bitten by this issue today. Can we at least improve the error message?
this seems to come up from time to time: http://forum.dlang.org/thread/skvasiwykiqpcrbrrzyp@forum.dlang.org or: http://stackoverflow.com/questions/6401365/why-does-std-algorithm-fill-not-accept-character-arrays/6401889#6401889
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/bab801c6723a945282b9b778c671791e6676937c fix issue 16342 - add std.algorithm.mutation.fill fallback for mutable strings https://github.com/dlang/phobos/commit/c6aa7b8ada515c487687e42ebf6d2d733e0cab93 Merge pull request #5128 from BBasile/issue-16342 fix issue 16342 - add std.algorithm.mutation.fill fallback for mutable strings merged-on-behalf-of: Jack Stouffer <jack@jackstouffer.com>
Commits pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/bab801c6723a945282b9b778c671791e6676937c fix issue 16342 - add std.algorithm.mutation.fill fallback for mutable strings https://github.com/dlang/phobos/commit/c6aa7b8ada515c487687e42ebf6d2d733e0cab93 Merge pull request #5128 from BBasile/issue-16342
Commits pushed to newCTFE at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/bab801c6723a945282b9b778c671791e6676937c fix issue 16342 - add std.algorithm.mutation.fill fallback for mutable strings https://github.com/dlang/phobos/commit/c6aa7b8ada515c487687e42ebf6d2d733e0cab93 Merge pull request #5128 from BBasile/issue-16342
Commit pushed to dmd-cxx at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/c6aa7b8ada515c487687e42ebf6d2d733e0cab93 Merge pull request #5128 from BBasile/issue-16342