Baffled by compilation error for formattedRead

PhilipDaniels via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu May 7 16:59:49 PDT 2015


On Thursday, 7 May 2015 at 23:23:08 UTC, Justin Whear wrote:
> formattedRead takes its input by ref and consumes it.  Your 
> first two
> attempts are both passing the result of functions (dropExactly 
> and
> opSlice) which are temporary rvalues and can thus not be passed 
> by
> reference.  Here's more reading on the subject of rvalues: 
> http://
> ddili.org/ders/d.en/lvalue_rvalue.html

Ok, thanks, I see. It looks a little weird, but there is the same 
restriction in C#, actually. Must learn to read those D function 
signatures more closely...My excuse is it's 1 am :-)


More information about the Digitalmars-d-learn mailing list