Home » U++ Library support » U++ Core » Point implicit conversions  
	
		
		
			| Point implicit conversions [message #35449] | 
			Fri, 17 February 2012 17:10   | 
		 
		
			
				
				
				
					
						  
						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
		
		
		
 |  
	| 
		
	 | 
 
 
 |  
  
 
Goto Forum:
 
 Current Time: Tue Nov 04 04:36:58 CET 2025 
 Total time taken to generate the page: 0.09715 seconds 
 |