yank unary '+'?

Lukas Pinkowski Lukas.Pinkowski at web.de
Tue Dec 8 14:28:10 PST 2009


Bill Baxter wrote:
> I say you should completely chop it then.  Leaving it in for literals
> only leaves a mess that's hard to justify.
> I have often written things like
> 
>   glVertex2f(-boxRadius,-boxRadius);
>   glVertex2f(+boxRadius,-boxRadius);
>   glVertex2f(+boxRadius,+boxRadius);
>   glVertex2f(-boxRadius,+boxRadius);

I'm doing the same thing myself, too. 

I'm using the unary plus not only for documentation, but also for expressing 
intention: It symbolizes that I did not forget a minus sign for that 
specific value. This way a missing unary minus or unary plus makes me 
suspicious that I have done something wrong in my numerical code.



More information about the Digitalmars-d mailing list