does std.file.slurp work with string data field?
Big Tummy
bigtummy at gmail.com
Thu Dec 26 18:16:25 PST 2013
On Friday, 27 December 2013 at 02:05:42 UTC, bearophile wrote:
> Big Tummy:
>
>> auto arr = "data.txt".slurp!(string, int)("%s, %s");
>
> Use (I also have added a space after the second %s because
> slurp is buggy with Windows-style newlines):
>
> auto arr = slurp!(string, int)("data.txt", "%s, %s ");
>
> Bye,
> bearophile
Not working for me. It seems to have something to do with string
not being swappable:
> rdmd mytest.d
core.exception.AssertError at std.algorithm(1942): Assertion failure
----------------
/tmp/.rdmd-1001/rdmd-my2.d-AEA8686B37E3195901320EEC6C7A9E25/my2(_d_assertm+0x16)
[0x80b0766]
/tmp/.rdmd-1001/rdmd-my2.d-AEA8686B37E3195901320EEC6C7A9E25/my2()
[0x80b4a3a]
/tmp/.rdmd-1001/rdmd-my2.d-AEA8686B37E3195901320EEC6C7A9E25/my2(pure
nothrow @trusted void
std.algorithm.swap!(std.typecons.Tuple!(immutable(char)[],
int).Tuple).swap(ref std.typecons.Tuple!(immutable(char)[],
int).Tuple, ref std.typecons.Tuple!(immutable(char)[],
int).Tuple)+0x59) [0x80aae01]
More information about the Digitalmars-d
mailing list