C++ Shorten subsequent function calls
问题 I try to find a way in C++17 to shorten following function calls: GetCurrentContext()->GetEntityManager()->CreateEntity(); maybe to something like: EM()->CreateEntity(); I tried a function pointer, but this is only valid for static functions: constexpr auto &EM = GetContext()->GetEntityManager; // error: reference to non-static member function must be called; Is there a better solution than using a Macro? #define EM GetContext()->GetEntityManager When using an inline function call, i'm afraid