
Le 16/01/13 13:20, TONGARI a écrit :
2013/1/16 Vicente J. Botet Escriba <vicente.botet@wanadoo.fr>
Le 15/01/13 18:44, Jeffrey Lee Hellrung, Jr. a écrit :
(b) in those rare situations, explicitly using gotos and labels (with a
descriptive name) is reasonably brief and readable; so I would be hesitant to adopt this.
When we use label/goto directly there is a risk that the user goto to the label without constructing all the scoped variables, v in this case.
if (cnd3) goto L; // bad as v constructor will not be called. { T v; for(;;) { while (cnd) { if (cnd2) goto L; // go to [1] } } L: // [1] std::cout << v <<std::endl; }
Actually this won't compile if T is not a POD.
You are right. Sorry for the noise. Vicente