Both gcc and Visual Studio generated the exact same machine code for both forms (as well as for !flag), so neither version would be faster than the other for platforms using those compilers. Frankly, I'd be surprised if any compiler generated different code for the two forms.