<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><blockquote type="cite" class=""><div class=""><div dir="auto" class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="">e.g. I think this is great:</div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class=""><div class=""><font face="monospace, monospace" class="">auto ptr = std::make_unique&lt;Foo&gt;(bar);</font></div></blockquote><div class="">Proposed rule: if the type is obvious because it's on the line, then auto is good.</div><div class="">Similarly:</div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class=""><div class=""><font face="monospace, monospace" class="">auto i = static_cast&lt;int&gt;(j);</font></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class=""><div class=""><font face="monospace, monospace" class="">auto foo = make_foo();</font></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class=""><div class=""><font face="monospace, monospace" class="">auto bar = something.get_bar(); // Sometimes, "bar" is obvious.</font></div></blockquote></div></div></blockquote>I'm not sure I agree with this style. There are times where the type of an auto variable is obvious-enough, but it's almost&nbsp;<i class="">never</i>&nbsp;more obvious than actually writing out the types.</div></div></blockquote><div><br class=""></div>In the first case, static_cast&lt;int&gt;, the type is written out on the same line. Same goes for other casts, make_unique&lt;T&gt;, and so on. Would you accept auto in those cases? If not, what benefit do you get from seeing the type twice on one line?</div><div><br class=""></div><div>I think the second and third cases are somewhat rare in WebKit, and I might agree against using auto. For example:</div><div><br class=""></div><div>RefPtr&lt;T&gt; thing;</div><div>auto* context = something.context();</div><div>context-&gt;setThing(thing.get()); // I need to research why context-&gt;thing is allowed to be a raw pointer, but I don’t know what context is.</div><div><br class=""></div><div>Geoff</div></body></html>