Christof Meerwald@freec++.prog | |||||
While Statement Conditionint Ac = 0, Ad = 0; struct A { A( bool b ) : b ( b ) { Ac++; } operator bool() { return b; } ~A() { Ad++; } bool b; }; int main() { int i = 0; while (A a = (i < 2)) { if (Ac != (Ad + 1)) return 1; i++; } if (!(Ac == 3 && Ad == 3)) return 1; int a = 0; return 0; } | |||||
This Web page is licensed under the Creative Commons Attribution - NonCommercial - Share Alike License. Any use is subject to the Privacy Policy.
Revision: 1.2, cmeerw.org/prog/freecpp/while_stmt_cond.html Last modified: Mon Sep 03 18:20:50 2018 |
Christof Meerwald <cmeerw@cmeerw.org> XMPP: cmeerw@cmeerw.org |