Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Rect_ operators overloading suggestion
Rect_ operators overloading suggestion [message #13412] Fri, 04 January 2008 18:25 Go to previous message
chickenk is currently offline  chickenk
Messages: 169
Registered: May 2007
Location: Grenoble, France
Experienced Member
I would like to make a suggestion. I may have missed an important point so my suggestion would not make sense; don't hesitate to blame me for that. Smile

I can see these overloads:
Rect_& operator+=(Sz sz){ Offset(sz); return *this; }
Rect_& operator+=(Pt p) { Offset(p); return *this; }
[...]
Rect_& operator-=(Sz sz){ Offset(-sz); return *this; }
Rect_& operator-=(Pt p) { Offset(-p); return *this; }

I agree with the Pt-argumented functions but I think it would make more sense for Sz-argumented functions to modify the size of the Rectangle instead of translating it...

For example, the following code could be used (I've not tested it):
Rect_& operator+=(Sz sz){ SetSize(Size()+sz); return *this; }
[...]
Rect_& operator-=(Sz sz){ SetSize(Size()-sz); return *this; }

What do you think about it ?

regards,
Lionel
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: A couple of issues with a test app
Next Topic: Dynamic Variable Names
Goto Forum:
  


Current Time: Sat Apr 27 15:49:56 CEST 2024

Total time taken to generate the page: 1.03576 seconds