From: stephan b. <st...@ei...> - 2003-09-05 08:56:30
|
On Friday 05 September 2003 09:39, Rusty Ballinger wrote: > void f1(QString &s) { } > f1(QString()); // doesn't compile!? > void f2(const QString &s) { } > f2(QString()); // does compile Right - it's illegal to pass a non-const reference to a temporary. (at least that's what gcc 2.95.x said in this case, IIRC.) > So I was looking in the C++ ARM to figure out whether that's correct, > and in my copy, on page 308, someone has scribbled the words "RUSTY > YOU ARE A BOZO" in handwriting which is remarkably similar to mine. So now we know where the nickname comes from, eh? (Where DOES that nickname come from?) > But I did find on page 146 the bit which proves I'm not a *total* > bozo: "In early versions of C++ where temporaries were allowed as > initializers for non-const references..." Ha ha ha, and on page 155: > "Naturally, this feature will be faded out of implementations > slowly..." Very, very, very slowly ;) > Anyway, I guess I'll be fixing tonight's changes tomorrow... Take your time. i spent all of last night tweaking the ser-txt parser, extending the syntax in optional ways. e.g., properties can be defined any of these ways: foo bar foo 'bar bar' foo "bar bar" foo = something or other foo = something else; // ; gets stripped Also, semicolons are now optional after a closing brace (for no good reason other than to learn lex). i broken backslash-escaped lines, but i read about a decent way to fix that this morning and will correct that tonight. -- ----- stephan st...@ei... - http://www.einsurance.de "...control is a degree of inhibition, and a system which is perfectly inhibited is completely frozen." -- Alan W. Watts |