Tech Off Post

Single Post Permalink

View Thread: N/T
  • User profile image

    Oh, and short circuiting isn't really about optimizing.  I doubt there is any language spec that would leave this as an optimization (IOW, leave it up to an implementation to decide how to behave here).  Optimizations are optional implementation details that are not allowed to modify the significant behavior of the code.  Short circuiting most certainly drastically modifies the significant behavior, and thus must be specified as always occurs or never occurs and compilers are unable to "optimize" the code beyond that.