<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br><br>Sent from my iPhone</div><div><br>On Apr 14, 2015, at 8:21 PM, Richard Trieu <<a href="mailto:rtrieu@google.com">rtrieu@google.com</a>> wrote:<br><br></div><blockquote type="cite"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">> -    for (const auto &MapEntry : VMap) {<br>
> +    for (const auto MapEntry : VMap) {<br>
<br>
What's the deal with this change? Is the type small & trivially<br>
copyable & we're suggesting using values instead of references?</blockquote></blockquote><blockquote type="cite"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="display: none;"><br>
<br></div></blockquote><div>VMap does not return a reference, so remove the reference type to indicate a copy is always made.</div></blockquote>Are there any cases where you'll change something from ref to a value because it's 'small and trivially copyable'?<div><br></div><div>If so, my worry is what happens if I change the type to be a bit larger or less trivial to copy. How will I be able to spot the range based for loop uses (which now do a copy) and change them back to refs? The problem is that changing them back in that way could result in false positives because perhaps in some uses I wanted the copy and in others I didn't.</div><div><br></div><div>So basically, are we able to reliably detect when to do the reverse transformation at a later date, and if not, should we do a transform now that is potentially difficult to undo later?</div><div><br></div><div>Cheers</div><div>Pete</div></body></html>