Macro should simplify direct usage of methods for both static and dynamic polymorphism and the mix of them.
When we have concrete class we should prioritize calling exact method over calling virtual method. If we don’t do that in the case of mixed polymorphism, we can end up with a infinite recursion because call to concrete method might be interpreted as a virtual call.
When we have only abstract class we should just call its virtual method.
First argument should be a type of class, the second argument should be an instance of the class, the third argument will be the name of the method and rest variadic arguments would be arguments for the method.
https://github.com/linksplatform/Data.Doublets/blob/22d79feaef5438c6f4684fa6105583e56129ff79/cpp/Platform.Data.Doublets/ILinksExtensions.h#L527-L531
Macro should simplify direct usage of methods for both static and dynamic polymorphism and the mix of them. When we have concrete class we should prioritize calling exact method over calling virtual method. If we don’t do that in the case of mixed polymorphism, we can end up with a infinite recursion because call to concrete method might be interpreted as a virtual call. When we have only abstract class we should just call its virtual method.
It is possible to use variadiac arguments for macro: https://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html
First argument should be a type of class, the second argument should be an instance of the class, the third argument will be the name of the method and rest variadic arguments would be arguments for the method.
Macro should be placed in Macros.h file.