
26 May
2010
26 May
'10
8:16 p.m.
Granted, but why not overload versus introduce a long name like "swap_in_place?"
My reasoning: 1) You cannot overload based on const vs non-const ref, so these two functions wouldn't work: template<typename T> void swap(T & t); template<typename T> T swap(const T & t); 2) Even if you could, I think the name swap_in_place<>() better expresses the intent of the function. However, I could rename it to "swap_loc" or something similar if that's preferable to users. Tom