stdio line-streaming revisited

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Thu Mar 29 15:12:28 PDT 2007


kris wrote:
> Frits van Bommel wrote:
>> Yes, call-chaining can only evaluate left-to-right, but the parameters 
>> *passed* to the calls can be evaluated in any order.
> 
> That's not at stake here, as far as I'm aware?

What I meant to say was that in 'Cout ("Hello, ") (Cin.get);' there's no 
guarantee that Cin.get will evaluate before Cout("hello, "). (though it 
_is_ guaranteed that sending that value to the output buffer will happen 
after the string gets sent)
Just because "Hello, " is somewhat unlikely to fill up the output buffer 
right after a flush (as it was in the code sample in question) doesn't 
mean it's okay to first output that and *then* ask for the name to put 
after it. At least, IMHO.



More information about the Digitalmars-d mailing list