This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: c++ "with" keyword
- From: dewar at gnat dot com (Robert Dewar)
- To: ates100 at web dot de, gcc at gnu dot org
- Date: Sat, 4 Jan 2003 14:13:16 -0500 (EST)
- Subject: Re: c++ "with" keyword
> ... and potentially two new variables in your code and binary.
> what i wanted to have:
>
>
> {
> #define y long_descriptive_expression_I_dont_like_repeating;
> #define z long_descriptive_expression_I_dont_like_repeating;
>
> z.memberA = z.memberB;
> z.memberB = y.memberA;
> #undef z
> #undef y
> }
>
> but this is just ugly.
Saying something is ugly is not an argument. It is the absence of a useful
argument. What are you suggesting we do, take a vote to find out which
form more people find ugly?
(hint: you will probably lose, most C++ programmers will be quite familiar
with the construct above, but will find the proposed WITH unfamiliar and
thus ugly).
As for two new variables. One would hope not, a stupid compiler might do
that, but then a stupid compiler might generate junk copies to implement
WITH. You really can't base arguments on fantasies about what stupid
compilers might or might not do.
In short, you have given no technical arguments to prefer your new form
over the familiar existing technique.