U++ framework
Do not panic. Ask here before giving up.

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: 14290
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: Sun Apr 26 09:43:49 GMT+2 2026

Total time taken to generate the page: 0.00860 seconds