I have the following problem:
Let’s consider we have
#define SET callMe
#define COLUMN(x) #x
and in our main block of our program we have the following line:
SET(COLUMN(price)="hi"); which after the preprocessor running is translated to:
#callMe("price"="hi");
I need function callMe signature to be callMe(string str) so that leaves us to have to make something to make the "price"="hi" to "price=hi" and let callMe function to handle the rest of the problem. Last thing to state is that all this program I describe is a part of a Table class.
The only option I have is overload the operator = so the "price"="hi" translated to the wanted one, but I can’t get what I should overload because I first thought that doing the following overload
#std::string operator=(std::string str) as a member function of the Table class but it seems I can’t get it right on track.
Any clues of how I can achieve the wanted operations?
Is this any good to you?
which results in:
This essentially gets the preprocessor to remove COLUMN before converting to a string.