A simple question: how can I shorten the name of the call without using define.
For example, I have a singleton, which I have to call, which is in the namespace (I cannot use it using the blabla namespace , because this is invalid):
MyFW::GameRoot::Instance()->DoSomething();
Now I can assign this to a variable that works several times, if I use it several times within the same class / function, but using it in many classes / functions, it becomes cumbersome. I decided to use #define for it:
#define MyFW::GameRoot::Instance() ROOT
ROOT->DoSomething();
Much better, and I really like it, especially because now, wherever I am, ROOT (color is encoded via V-Assist), I know that right away ... if I don't have a breakpoint and I need Visual Studio to solve the ROOT is displayed in the clock window (or even hang it on it to quickly pull out the object in debugging), which it cannot do.
Is there any other option? What are you doing to shorten the names? Just use local / member pointers to store the instance?
Thank!
source
share