[Issue 10262] utf.decodeFront doesn't work with a string slice

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jun 4 00:50:54 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10262


Jonathan M Davis <jmdavisProg at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |jmdavisProg at gmx.com
         Resolution|                            |INVALID


--- Comment #1 from Jonathan M Davis <jmdavisProg at gmx.com> 2013-06-04 00:50:53 PDT ---
It's not supposed to work with a slice like that. It accepts arguments by ref
and pops off elements from the range that it's given, so it requires that you
give it an lvalue, which is what you did with

string s2 = str[1..$];
decodeFront(s2, size);

It accepted rvalues in 2.062, but that resulted in very inconsistent and
potentially buggy behavior (depending on the type of range), so it now accepts
the range by ref.

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


More information about the Digitalmars-d-bugs mailing list