next!T

Chris Nicholson-Sauls via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jun 6 19:57:30 PDT 2014


On Saturday, 7 June 2014 at 02:23:18 UTC, Andrew Edwards wrote:
>
> This function now works for all types except dstring. This 
> remains a problem I cannot figure out. The error code is as 
> follows:
>
> $ rdmd -unittest textnext
> /usr/share/dmd/src/phobos/std/conv.d(3293): Error: cannot 
> modify immutable expression c
> /usr/share/dmd/src/phobos/std/conv.d(3297): Error: cannot 
> modify immutable expression c
> /usr/share/dmd/src/phobos/std/conv.d(2904): Error: template 
> instance std.conv.parseElement!(immutable(dchar), string) error 
> instantiating
> io.d(64):        instantiated from here: 
> parse!(immutable(dchar)[], string)
> textnext.d(12):        instantiated from here: 
> next!(immutable(dchar)[])
> io.d(64): Error: template instance 
> std.conv.parse!(immutable(dchar)[], string) error instantiating
> textnext.d(12):        instantiated from here: 
> next!(immutable(dchar)[])
> textnext.d(12): Error: template instance 
> io.next!(immutable(dchar)[]) error instantiating
> Failed: ["dmd", "-unittest", "-v", "-o-", "textnext.d", "-I."]
>
> This error is report failure on dstring at [2] but I fully 
> expected them at [1].
>
> I've looked at implementation of isSomeString() 
> (https://github.com/D-Programming-Language/phobos/blob/master/std/traits.d#L5178) 
> and clearly dstrings are addressed in the implementation there. 
> What exactly am I missing in my understanding?
>
> Any assistance/advice is appreciated.
>
> Thanks,
> Andrew


I got it working here by putting an else before the second 
static-if.


More information about the Digitalmars-d-learn mailing list