[Interest] Strange undeletable QTemporaryFile. Is it a bug?
Till Oliver Knoll
till.oliver.knoll at gmail.com
Sat Aug 24 19:16:19 CEST 2013
Am 24.08.2013 um 18:36 schrieb Thiago Macieira <thiago.macieira at intel.com>:
> On sábado, 24 de agosto de 2013 12:00:07, Till Oliver Knoll wrote:
>> C++ makes this easy for you:
>> #define private public
>> #include "Foo.h"
> Doesn't work with MSVC,
Ha! I /knew/ it! MS is totally not adhering to "the standard" *rant* *rant*...
Okay, you got me there, I never actually tried it myself, even though unit-testing private methods was also the first thing which came to my mind as being very useful when I learnt this Evil Trick here on qt-interest (I think).
The context was a similar one: trying pointer arithmetic, iterating over virtual function tables, casting... until someone just came up with this #define thing. At that time the simplicity and elegance just blew my mind - C++ rocks! It just gave me a rocket launcher to shot into my foot! ;)
> since the protection level is encoded in the member
> function's name.
I am pretty sure that even the naming might be overcome with a little #define wizardry, no? ;)
More information about the Interest