I wonder if it is possible to use boost :: mpl / preprocessor or some noce C ++ 11 functions to create a proxy for a function from the class type and function name.
Say we had:
inline void set_email(const ::std::string& value); inline void set_email(const char* value);
Inside the Email class. We know that there is a set_email n function, we want to create a prox class with an API like
PROXY(Email, set_email, MyEmail) Email * email = new Email(); MyEmail * myEmail = new MyEmail(email);
and have the ability to call any of the set_email overloads. Is it possible and how to create a class that proxies any number of overload functions without knowing their types (only names)?
c ++ boost c ++ 11 boost-preprocessor boost-mpl
myWallJSON
source share