C++, Templates, Preprocessor on the SGI (cfront)
Rainer Sinkwitz
sinkwitz at ifi.unizh.ch
Fri Jun 28 17:49:09 AEST 1991
In article <9106272305.AA10159 at enuxha.eas.asu.edu>, nwatson at ENUXHA.EAS.ASU.EDU (Nathan F. Watson) writes:
> I am using cfront (AT&T C++) on an SGI, and would like to use the
> '##' (concatenator) preprocessor 'statement' when defining a template.
> from my understanding, a file
>
> #define concat(a,b) a##b
> concat(asdf,jkl)
>
> should produce the file
>
> asdfjkl
>
> after preprocessing. I've tried variations of the above (e.g.
> putting spaces before, after the "##"). What do I need to do
> to allow this? Forgive me if the question is frequently asked,
> as I'm new to C++.
>
> ---------------------------------------------------------------------
> Nathan F. Watson Arizona State University
> nwatson at enuxha.eas.asu.edu Computer Science Department
> "Remember: No matter where you go, there you are." - Mr. B. Banzai
Sometime ago a saw a thing like the following. It works with the ordinary
C-Preprocessor and should also work with C++ :
#define IDENT(x) x
#define concat(a,b) IDENT(a)b
Greetings...
--
Rainer Sinkwitz | E-mail: sinkwitz at ifi.unizh.ch
Dept. of Computer Science | sinkwitz%ifi.unizh.ch at relay.eu.net
University of Zuerich | {backbone}!mcsun!unizh!sinkwitz
More information about the Comp.sys.sgi
mailing list