[Issue 14797] template with inout parameter `foo(String: inout(CharT)[], CharT)` should be implicitly instanciated as foo!(char[], char)

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Jul 13 07:14:06 PDT 2015


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

Steven Schveighoffer <schveiguy at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |schveiguy at yahoo.com
         Resolution|---                         |INVALID

--- Comment #1 from Steven Schveighoffer <schveiguy at yahoo.com> ---
This is expected behavior. What you have is a specialization for inout(CharT)
where str is inout(CharT)[], and you are passing in just char[], which doesn't
match the specialization.

IFTI breaks down in certain ways with specializations, but this should work if
you have an inout(char)[] to pass in.

I think all you need to do to fix your example is:

inout(dchar)[] foo(CharT)(inout(CharT)[] str)

--


More information about the Digitalmars-d-bugs mailing list