Hi,
Can somebody help me with this problem : I have the following member
functions
#define FUNC(x) get##()
class A
{
the declarations etc, etc.
};
string A::getDescription()
{
return desc;
}
int A::getNumber()
{
return number;
}
Here come the problem :
string A::makeSQLString(string field)
{
stringstream s;
s << "select * from customer where " << field << " = " << XXXX
return s.str();
}
If want XXX to expand to getDescription or getNumber functions depending on
the value of field. I tried it with a macro FUNC ( see above ) but that
gives me FUNC(field) in the sql string. The func has to expanded to
getNumber or getDescription function.
How to do this
John