Thursday, June 11, 2015

TIL: never depend on the order of evaluation of sub-expressions in a stream

The code below may result in a 6 different execution orders. It will surprise and hurt you, so don't do that ;-)
std::cout << wizard.CastSpell("abracadabra") << wizard.DrinkPotion("Rosanke") << wizard.Mana();
More info can be found:

No comments:

Post a Comment