August 24, 2012
With the C/C++ preprocessor, is there a way to have a macro argument expand like this? (where '??????' is what I don't know what to write):

// Just an illustrative example obviously pointless as-is:

#define FACTORY_OF(a)  ??????
FACTORY_OF(Bar).blah

// Make that expand to:
BarFactory.blah

August 24, 2012
On Thu, 23 Aug 2012 21:31:53 -0400
Nick Sabalausky <SeeWebsiteToContactMe@semitwist.com> wrote:

> With the C/C++ preprocessor, is there a way to have a macro argument expand like this? (where '??????' is what I don't know what to write):
> 
> // Just an illustrative example obviously pointless as-is:
> 
> #define FACTORY_OF(a)  ??????
> FACTORY_OF(Bar).blah
> 
> // Make that expand to:
> BarFactory.blah
> 

Oops, found what I needed here:

http://gcc.gnu.org/onlinedocs/cpp/Concatenation.html

Solution:
#define FACTORY_OF(a)  a##Factory