#define private public
#include <SomeClassWithPrivateMembers.h>
For those who are not familiar with C++, the #define private public say that "Starting from now, each time you see “private” word, replace it with “public”.
Meaning, you can now access private members of following class.
I had to do this to workaround an uninitialized private variable in a 3rd part, leading to a crash.
Definitely an anti-pattern and doesn't work every time (create some low level binary incompatibilities).
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
For those who are not familiar with C++, the
#define private publicsay that "Starting from now, each time you see “private” word, replace it with “public”.Meaning, you can now access private members of following class.
I had to do this to workaround an uninitialized private variable in a 3rd part, leading to a crash.
Definitely an anti-pattern and doesn't work every time (create some low level binary incompatibilities).