On Thu, 07 May 2015 23:10:26 +0000, PhilipDaniels wrote: > Why do the first two fail to compile but the last one does?! I cannot > see any difference between the 's2' case and the second case, it is a > completely mechanical source code transformation I have made.
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