Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #15149
| From | thomas <freshthomas@gmail.com> |
|---|---|
| Newsgroups | comp.lang.c++ |
| Subject | Re: macro definition for different compile configurations |
| Date | 2012-03-27 18:00 -0700 |
| Organization | http://groups.google.com |
| Message-ID | <23874159.110.1332896453592.JavaMail.geo-discussion-forums@vbai14> (permalink) |
| References | <26170974.62.1332833351847.JavaMail.geo-discussion-forums@ynel5> <29708976.1032.1332857135546.JavaMail.geo-discussion-forums@ynim7> <oer3n79jhgetu03kpaoa7tpi59pu68k7u9@4ax.com> |
On Wednesday, March 28, 2012 12:49:09 AM UTC+8, Geoff wrote:
> On Tue, 27 Mar 2012 07:05:35 -0700 (PDT), thomas
> <freshthomas@gmail.com> wrote:
>
> >On Tuesday, March 27, 2012 3:29:11 PM UTC+8, thomas wrote:
> >> Hi,
> >> I'm stucked by something appears really simple at first sight.
> >>
> >
> >Seems that you don't understand what I am talking about, just judging by some keyword mentioned.
>
> Try replying to the people your post is intended to reply to instead
> of yourself.
>
> You have not clearly stated your problem.
>
> If you are coding C++ you do not need to write macros to define your
> functions using compile time switches. You can simply define your
> functions simultaneously in the same scope and let the compiler choose
> which overloaded function to use based on the function call.
>
> Defining:
>
> int f(int x, int y){}
> int f(int x){}
> int f(){}
>
> Calling:
>
> i = f(x,y);
> i = f(x);
> i = f();
>
> The compiler will choose the proper function that matches the
> arguments in the function call.
Well, I know that overloading can make the same function name work for different parameter list. But I want to see different functions for different configurations. If I define both, it's confusing which is used when. Sometimes the parameter in difference is just meaningness in some configurations.
Back to comp.lang.c++ | Previous | Next — Previous in thread | Find similar | Unroll thread
macro definition for different compile configurations thomas <freshthomas@gmail.com> - 2012-03-27 00:29 -0700
Re: macro definition for different compile configurations Victor Bazarov <v.bazarov@comcast.invalid> - 2012-03-27 07:58 -0400
Re: macro definition for different compile configurations thomas <freshthomas@gmail.com> - 2012-03-27 06:44 -0700
Re: macro definition for different compile configurations Qi <no@no.com> - 2012-03-27 21:53 +0800
Re: macro definition for different compile configurations Juha Nieminen <nospam@thanks.invalid> - 2012-03-27 17:31 +0000
Re: macro definition for different compile configurations thomas <freshthomas@gmail.com> - 2012-03-27 07:05 -0700
Re: macro definition for different compile configurations Geoff <geoff@invalid.invalid> - 2012-03-27 09:49 -0700
Re: macro definition for different compile configurations Stuart Redmann <DerTopper@web.de> - 2012-03-27 11:27 -0700
Re: macro definition for different compile configurations Geoff <geoff@invalid.invalid> - 2012-03-27 11:46 -0700
Re: macro definition for different compile configurations Stuart Redmann <DerTopper@web.de> - 2012-03-27 12:39 -0700
Re: macro definition for different compile configurations Ian Collins <ian-news@hotmail.com> - 2012-03-28 08:49 +1300
Re: macro definition for different compile configurations Stuart Redmann <DerTopper@web.de> - 2012-03-27 12:58 -0700
Re: macro definition for different compile configurations Geoff <geoff@invalid.invalid> - 2012-03-27 15:50 -0700
Re: macro definition for different compile configurations Juha Nieminen <nospam@thanks.invalid> - 2012-03-28 08:14 +0000
Re: macro definition for different compile configurations Stuart Redmann <DerTopper@web.de> - 2012-03-28 07:30 -0700
Re: macro definition for different compile configurations thomas <freshthomas@gmail.com> - 2012-03-27 18:00 -0700
csiph-web