<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br>02 ÿíâ. 2014 ã., â 13:12, Geoffrey Garen <<a href="mailto:ggaren@apple.com">ggaren@apple.com</a>> íàïèñàë(à):<br><br><blockquote type="cite">I think an appropriate style guideline for “auto” would say something like:<br><br>- Use “auto" to declare a disgusting templated iterator type in a loop<br>- Use “auto… ->" to define a template-dependent return type in a class template<br>- In all other cases, use an explicit type declaration<br></blockquote><div><br></div><div>+1</div><div><br></div><div>What do you think about these examples?</div><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"> <span style="color: #bb2ca2">auto</span> failureCallback = [promiseWrapper]() <span style="color: #bb2ca2">mutable</span> {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"> promiseWrapper.<span style="color: #31595d">reject</span>(<span style="color: #bb2ca2">nullptr</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"> };</div></div><div><br></div><div>…</div><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"> <span style="color: #bb2ca2">auto</span> iter = <span style="color: #4f8187">m_nameToIdentifierMap</span>.<span style="color: #3d1d81">find</span>(name.<span style="color: #3d1d81">isolatedCopy</span>());</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(79, 129, 135);"><span style="color: #000000"> </span><span style="color: #bb2ca2">if</span><span style="color: #000000"> (iter == </span>m_nameToIdentifierMap<span style="color: #000000">.</span><span style="color: #3d1d81">end</span><span style="color: #000000">())</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(187, 44, 162);"><span style="color: #000000"> </span>return<span style="color: #000000"> </span>false<span style="color: #000000">;</span></div></div><div><span style="color: #000000"><br></span></div><div>- WBR, Alexey Proskuryakov</div><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div><br></div></span>
</div>
</body></html>