French software engineer with 15 year experience on 3D data visualisation and processing. Lots of C++, and switch to Unity recently.
I like when it run fast ๐
#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).