Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] User survey: More CDT Refactorings - toggle function definition/namespace refactorings

> >> One participant asked for "change function signature" refactoring  
> and I have to say this is very very hard to do well for C++. We tried!  
> There are several reasons, especially when you 
> >> expect call sites to be adapted, one is overload resolution that  
> might change due to a changed signature, so even if you called the  
> function before the change changing it actually might 
> >> select a different overload at the call site, 
>  
> > Please excuse my ignorance. Isn't the same overload resolution  
> problem exist in Java? 
>  
> Yes, but the overload resolution rules are more complex in C++. 
> You can have things like changing the signature of a template 
> overload causing that template to now be a better match than 
> another overload for some call sites. So, call sites can require 
> a more careful examination than in Java. 
>  
> The same is true for method rename, isn't it? 

Well, for a method rename not all call sites are potentially
problematic - only call sites of the new name that used to
match another overload of the new name but now match
the renamed one. I think it would be useful if the method
rename refactoring pointed the user to such call sites.

On the flip side, just like the rename refactoring is useful
without pointing the user to such call sites, the change
signature refactoring would be useful if it didn't do anything
will call sites as well.

Regards,
Nate 		 	   		  

Back to the top