is !! stable proceed modify bool c++?
[this doubt associated nonetheless same .]
if i try values certain forms boolean expressions, i warning. rather conceal warning, i infrequently ternary user (?:) modify bool. controlling twin operators (!!) seems same thing.
here's i mean:
typedef enlarged t; // identical warning vacant * double
t t = 0;
bool b = t; // opening warning: forcing 'long' value 'bool'
b = t ? loyal : false; // ok
b = !!t; // any different?
so, does double-not technique unequivocally same thing? any some-more reduction stable ternary technique? technique equally stable non-integral forms (e.g., void * double t)?
i'm seeking !!t good style. i am seeking semantically opposite t ? loyal : false.
Comments
Post a Comment