3 ms·
This is a very specific case, if there is any other function that sets the pointer, the behavior is what you'd expect. https://godbolt.org/g/C3SYXt https://godb
by guipsp 9y ago
This is a very specific case, if there is any other function that sets the pointer, the behavior is what you'd expect. https://godbolt.org/g/C3SYXt https://godbolt.org/g/C3SYXt
- Ded7xSEoPKYNsDd 9y agoIt might be what you expect for that particular compiler, but there's no guarantee. A different compiler might decide that because `Do` has only two possible values, that it should replace the dynamic function call with an if condition deciding between two static function calls like I did here manually, to trigger the bug again: https://godbolt.org/g/kWcvvb https://godbolt.org/g/kWcvvb