Based on what your actual problem is -- it seems like you need to refactor your code a little. Also, you should trust that the compiler optimizes correctly. eg. if( valueMeta.isValid && pointersSupported) should be optimized out when pointerSupported == false and the comparison of it should be optimized out when it is true.