[Issue 12470] New: std.array.replace does not work with inout(char)[]

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 25 15:13:30 PDT 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12470

           Summary: std.array.replace does not work with inout(char)[]
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrej.mitrovich at gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2014-03-25 23:13:19 CET ---
-----
import std.array;

inout(char)[] sanitize(inout(char)[] input)
{
    return input.replace("\0", " ");
}
-----

$ dmd test.d

-----
C:\dmd-git\dmd2\windows\bin\..\..\src\phobos\std\array.d(1835): Error: template
std.array.replaceInto cannot deduce function from argument types
!()(Appender!(inout(char)[]), inout(char)[], string, string), candidates are:
C:\dmd-git\dmd2\windows\bin\..\..\src\phobos\std\array.d(1844):       
std.array.replaceInto(E, Sink, R1, R2)(Sink sink, E[] subject, R1 from, R2 to)
if (isOutputRange!(Sink, E) && isDynamicArray!(E[]) && isForwardRange!R1 &&
isForwardRange!R2 && (hasLength!R2 || isSomeString!R2))
test.d(7): Error: template instance std.array.replace!(inout(char), string,
string) error instantiating
-----

Note that this is an internal library error.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list