Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!spool.mu.edu!uunet!mcsun!cernvax!chx400!unizh!sinkwitz From: sinkwitz@ifi.unizh.ch (Rainer Sinkwitz) Newsgroups: comp.sys.sgi Subject: Re: C++, Templates, Preprocessor on the SGI (cfront) Message-ID: <1991Jun28.074909.23230@ifi.unizh.ch> Date: 28 Jun 91 07:49:09 GMT References: <9106272305.AA10159@enuxha.eas.asu.edu> Sender: sinkwitz@ifi.unizh.ch (Rainer Sinkwitz) Reply-To: sinkwitz@ifi.unizh.ch (Rainer Sinkwitz) Organization: University of Zurich, Department of Computer Science Lines: 35 In article <9106272305.AA10159@enuxha.eas.asu.edu>, nwatson@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@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@ifi.unizh.ch Dept. of Computer Science | sinkwitz%ifi.unizh.ch@relay.eu.net University of Zuerich | {backbone}!mcsun!unizh!sinkwitz