www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18152] New: std.format.formatteedRead should work with rvalues.

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

          Issue ID: 18152
           Summary: std.format.formatteedRead should work with rvalues.
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: hsteoh quickfur.ath.cx

The following code should work:

-----
string[int] aa1;
formattedRead!("%s")(`[1:"hello", 2:"world"]`, aa1);
assert(aa1 == [1:"hello", 2:"world"]);

int[string] aa2;
formattedRead(`{"hello"=1; "world"=2}`, "{%(%s=%s; %)}", aa2);
assert(aa2 == ["hello":1, "world":2]);
-----

--
Jan 02