On Sun, Oct 4, 2009 at 5:58 PM, Andrei Alexandrescu <seewebsiteforem...@erdani.org> wrote: > bearophile wrote: >> >> opIf sounds strange :-) Why don't you like the idea of the implicit >> conversion to bool followed by the testing of the bool? (someone may >> have already answered a similar question, please bear with me). > > Try this: > > void * p; > if (p) {} > > Then try this: > > void * p; > bool b = p;
Okay, how about if if() used the result of an *explicit* cast to bool? Barring the silly opCast operator (and maybe providing something else), would this be consistent?