On Oct 31, 2012, at 2:45 AM, Richard Biener <richard.guent...@gmail.com> wrote:.
> My comment was for isolated code parts that are being rewritten
> (I think it was the wide-int class).  Consistency comes first.

In the case of wide int, we only use references in one very narrow way.  We use 
const T& as parameters instead of T, to avoid the copy of a large piece of 
data.  Otherwise, we use value semantic for the entire interface and we only do 
this optimization for one class, wide_int.  There is one other use, and that is 
for the logical operator [], which returns something that can be modified, 
again, this is for the cleanliness of the interface.  Since the entire 
interface is self consistent, I think we meet the goal of consistency.  One 
benefit of this interface choice is that we can support things like a+b, 
directly.  If we have used pointers, the natural a+1 would not be the value of 
a plus 1, but rather the nonexistent object that would be in memory after a, 
which isn't what we want.

Reply via email to