lundi 26 juin 2017

C++ or macro magic to generate method and forward arguments

I would like to create a magical macro, or anything, that would generate a something like this:

MAGICAL_MACRO(return_type, method_name, ...)

should work like this:

MAGICAL_MACRO(void, Foo, int a, int b)

->

virtual void Foo(int a, int b) 
{
    _obj->Foo(a, b);
}

Is this possible? I am afraid it is not.

Aucun commentaire:

Enregistrer un commentaire