Macro Reflection???

  • Thread starter Thread starter batwater
  • Start date Start date
B

batwater

Based on a given text I would like to call that corresponding macro.
Is this something that is even possible in Managed C++ or .NET?
Ideally I would like to do this without using a gigantic conditional
statement. (Additional Info if needed: The macro that I would like to
call simply returns an integer. The macro is defined in a traditional
c++ (i.e. unmanaged c++) file.) I have searched the web and groups and
have been unable to find my solution. Any help would be greatly
appreciated.
 
Macros cannot be called via reflection since after compilation they do not
exist. As an example if you have the macro:
#define INCREMENT(x) x++
and then use it:
INCREMENT(myVar);

it has no independent existance. The code will be expanded to:
myVar++;
 
Back
Top