The following code, which is the first example in the docs for std.algorithm.mutation.bringToFront, but using a char array instead of an int array:
-- bringToFront.d --
import std.algorithm : bringToFront;
void main(string[] args)
{
auto arr = ['4', '5', '6', '7', '1', '2', '3'];
auto p = bringToFront(arr[0 .. 4], arr[4 .. $]);
assert(p == arr.length - 4);
assert(arr == ['1', '2', '3', '4', '5', '6', '7']);
}
-- end of file --
fails on compilation with this:
..\src\phobos\std\algorithm\mutation.d(2553): Error: front(r1) is not an lvalue
..\src\phobos\std\algorithm\mutation.d(2554): Error: front(r2) is not an lvalue
..\src\phobos\std\algorithm\mutation.d(134): Error: template instance std.algorithm.mutation.swapFront!(char[], char[]) error instantiating
bringToFront.d(10): instantiated from here: bringToFront!(char[], char[])
..\src\phobos\std\algorithm\mutation.d(2553): Error: function std.range.Take!(char[]).Take.front () is not callable using argument types (dchar)
..\src\phobos\std\algorithm\mutation.d(2554): Error: front(r2) is not an lvalue
..\src\phobos\std\algorithm\mutation.d(134): Error: template instance std.algorithm.mutation.swapFront!(Take!(char[]), char[]) error instantiating
..\src\phobos\std\algorithm\mutation.d(163): instantiated from here: bringToFront!(Take!(char[]), char[])
bringToFront.d(10): instantiated from here: bringToFront!(char[], char[])
Compiled with rdmd, using dmd v2.072.0
Comment #1 by github-bugzilla — 2017-01-05T19:15:00Z