1

I know that this #define QUOTE(X) #X turns X into a c-string version of whatever is passed to it. my question is if there is a way to do this in reverse ie: #define DEQUOTEANDCALLFUNCTIONORCLASSWITHGIVENNAME(X) (X#)() is this possible?

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by mike_2000_17
0

This is a question that comes up from time to time on forums on C++. And, I'm convinced now that there is no way to do this. I hope I'm wrong, but I think there is little chance.

0

I feared as much :( time to write a function filled with string comparisons to each function I write... thanks anyways.

0

>>time to write a function filled with string comparisons to each function I write...

There is certainly a better solution than doing this. What are you trying to achieve?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.