Edward Rosten wrote:
> On Apr 14, 9:25 pm, Michael Aaron Safyan <michaelsaf...@[EMAIL PROTECTED]
>
> wrote:
>> Using operator% in this manner would never pass my code review, because
>> this usage has absolutely nothing to do with taking the modulus of a
>> value, and -- therefore -- this usage is unintuitive.
>
> Out of interest, would any of the following code pass your review:
>
> cout << "Hello, world." << endl;
>
No, it wouldn't have. However, it is now well-established practice.
> or
>
> string s;
> ...
> s += "Hello, world.";
Yes, this would, since you are "adding" the string (albeit not
arithmetically). I think it makes perfect sense to use operator+ and
operator+= for the concatenate/append operations.
>
> These expressions have respectively nothing to do with bit-****fting or
> addition.
>
> -Ed
>
--
[ See http://www.gotw.ca/resources/clcm.htm
for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]


|