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 » Point implicit conversions
Point implicit conversions [message #35449] Fri, 17 February 2012 17:10 Go to next message
lindquist is currently offline  lindquist
Messages: 33
Registered: March 2006
Location: Denmark
Member
Hi again.

I'm coming to the conclusion that implicit conversions for Point is really not a good idea.

Consider an application mainly using Pointf. I do this in my app for defining a bunch of geometry, then a bunch of functions have

const Pointf&

parameters.

However - twice now - I've accidentally made the parameter of type Point, using Alt+C/Alt+V to paste in the definition etc.

Everything compiles without warnings, but of course, the program misbehaves, as all the Pointf's I pass are converted to Point and back.

I think it's too easy to miss the f at the end of the type. Twice I've made the mistake, and it can be hard to find. Can these implicit conversions be removed ?

-Tomas
Re: Point implicit conversions [message #35471 is a reply to message #35449] Tue, 21 February 2012 09:23 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
lindquist wrote on Fri, 17 February 2012 11:10


I think it's too easy to miss the f at the end of the type. Twice I've made the mistake, and it can be hard to find. Can these implicit conversions be removed ?

-Tomas


Not without breaking a log of existing code... but we can still consider this.
Previous Topic: LaunchWebBrowser() requires ToSystemCharset() to work properly
Next Topic: CoWork and shared memory
Goto Forum:
  


Current Time: Wed Apr 24 18:37:00 CEST 2024

Total time taken to generate the page: 0.03322 seconds