3 ms·
Unless I'm mistaken, C++ was (deliberately) specified in such a way that such a redefinition does not affect the behavior of (most) already valid code. Perhaps
by npsimons 13y ago
Unless I'm mistaken, C++ was (deliberately) specified in such a way that such a redefinition does not affect the behavior of (most) already valid code.
Perhaps it doesn't change the implementation, but I know I've used the above trick to get access to private functions for unit testing (yes, yes, I know you "should" only test interfaces, or make internal tests; spare me and realize it's useful: http://mrzechonek.github.io/tut-framework/faq.html#can-we-test-private-methods http://mrzechonek.github.io/tut-framework/faq.html#can-we-te...)