<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Nov 6, 2015 at 7:08 PM, Richard via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><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">There seems to be a certain breed of programmer that once having<br>
learned a new feature of C++ intends to get out their new feature<br>
hammer and bang on everything in sight.<br></blockquote><div><br></div><div>I'm not native to the English language, but apparently breed is mostly reserved to plants and animals.</div><div>I doesn't read that nice IMHO. Perhaps avoid such denomination for programmers in the future. My $0.02.</div><div> </div><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">[... ] In other words, this code would be left alone:<br>
<br>
template <typename T, typename U><br>
auto add(T x, U y) -> decltype(x + y)<br>
{<br>
  return x + y;<br>
}<br>
<br>
There is one note in N2541 that states how the new syntax eliminates<br>
an ambiguity with this example:<br>
<br>
auto f() -> int (*)[4];<br>
// function returning a pointer to array[4] of int,<br>
// not function returning array[4] of pointer to int.<br>
<br>
This seems to be another case that should be left unchanged.<br></blockquote><div><br></div><div>In</div><div><br></div><div>struct Outer {</div><div>  struct Inner {};</div><div>  Inner getInner() { ... }</div><div>};</div><div><br></div><div>Instead of writing</div><div><br></div><div>Outer::Inner Outer::getInner() { ... }</div><div><br></div><div>I noticed that I can now write</div><div><br></div><div><div>auto Outer::getInner() -> Inner { ... }</div></div><div><br></div><div>If Outer is a long type name, not having to repeat it is kinda nice.</div><div>Of course client code must use Outer::Inner, unless it itself uses auto...</div><div><br></div>Similarly, in</div><div class="gmail_quote"><br></div><div class="gmail_quote">template <typename TPrivilege><br>auto PrivilegeSet<TPrivilege>::insert(const value_type& val)<br>  -> std::pair<iterator, bool><br>{ ... }</div><div class="gmail_quote"><br></div><div class="gmail_quote">iterator is a nested type, and not having to qualify it, nor using typename, thanks to trailing return, is "nice" IMHO.</div><div class="gmail_quote"><br></div><div class="gmail_quote">So am I "one of those people" with the above, or this is acceptable to you? --DD</div></div></div>