From -2981866341438369339 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fc772,a175c482da34ebf8 X-Google-Attributes: gidfc772,public X-Google-Thread: f78e5,765aa557d15ef5ba X-Google-Attributes: gidf78e5,public X-Google-ArrivalTime: 2003-05-03 17:42:01 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!uwm.edu!rpi!not-for-mail From: LLeweLLyn Newsgroups: comp.lang.c++.moderated,comp.std.c++ Subject: Re: Preprocessor evolution Date: 3 May 2003 20:44:09 -0400 Organization: The Illusory Sorting Algorithm Lines: 30 Sender: cppmods@netlab.cs.rpi.edu Approved: kuehl@inf.uni-konstanz.de Message-ID: References: <652361f.0304032218.6b7a67e4@posting.google.com> <3e8f6897.709822312@News.CIS.DFN.DE> <3e920e1f.883270640@News.CIS.DFN.DE> <3e9f0d33@andromeda.datanet.hu> <7f2735a5.0304241045.14708662@posting.google.com> NNTP-Posting-Host: netlab.cs.rpi.edu X-Auth: PGPMoose V1.1 PGP comp.std.c++ X-Approved-For-Group: Fergus Henderson comp.std.c++ X-Original-Date: 03 May 03 14:08:32 GMT X-Submission-Address: c++-submit@netlab.cs.rpi.edu X-Auth: PGPMoose V1.1 PGP comp.lang.c++.moderated iQBVAwUAPrRiVkHMCo9UcraBAQHW/AIAkwj0TEy04t5IlscEgd52W2i8Kf24YL2I Kiajw0DzMhaRExLNs/smvfRa2Rhuh9J9qdOWz95al1Xaid4GyMiNZw== =/DJl Xref: archiver1.google.com comp.lang.c++.moderated:65305 comp.std.c++:19163 allan_w@my-dejanews.com (Allan W) writes: > LLeweLLyn wrote > > Also, since the preprocessor is not going away, I would like to see an > > alternative to function like macros that do not require such > > things as the do{}while(0) idiom and parentheses around all > > arguments. I can't think of a good way to express this (yet) but > > that's what I want. > > How about making them functions -- but still expand inline? > We could call these "inline functions." > > :-) Rewrite this macro as an inline function: #define TRACE() do{\ if(debug_this_module) {\ logfile << __FILE__ << ":" << __LINE__ << ":" << endl; logfile\ << dump_stack_trace();\ }\ }while(0) :-) --- [ comp.std.c++ is moderated. To submit articles, try just posting with ] [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]