On 2012-3-27 21:44, thomas wrote:
> Ok...Please top quote. And keep your line width within 76
> And I can write the two versions of the functions with the following declaration.Using macro is neither neat nor easy to read.
> int f(PARAM_WITH_COMMA int y);
> int f(PARAM_NO_COMMA);
> In short I want to make my code neat and easy to read, that's to say, fewer "#ifdef" like stuff.
> So I'm trying to write some macros to shorten some word usage.
Whenever you can avoid macros, just avoid them.
You are using C++. C++ can do most stuff that macro can do.
> I just gave an example above using two marco definitions.There is comma_if in Boost library. You may check Boost
> Can I use just one macro to achieve the same thing?
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.