<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Mar 31, 2017 at 3:57 AM, Jonathan Wakely <span dir="ltr">&lt;<a href="mailto:cxx@kayari.org" target="_blank">cxx@kayari.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Do we need a macro for this? I can&#39;t think of a sensible example where<br>
it would help.<br>
<br>
#if __cpp_lib_emplace_return_type<br>
auto&amp; x = container.emplace_back(arg1, arg2);<br>
#else<br>
container.emplace_back(arg1, arg2);<br>
auto&amp; x = container.back();<br>
#endif<br>
<br>
If you want to work with compilers that don&#39;t implement the feature<br>
you have to write the second form anyway and you might as well just do<br>
that unconditionally. There&#39;s no efficiency benefit to the new form,<br>
it&#39;s just mildly simpler to write. But writing both forms isn&#39;t<br>
simpler.<br></blockquote><div><br></div><div>I concur with your reasoning; a macro for this is not useful.  (One more thing checks out too: users are not permitted to take the address of emplace_back anyway, so knowing its return type doesn&#39;t help with that, and it&#39;s discoverable with decltype anyway for cases where both forms could compile.)</div><div><br></div><div>There&#39;s no sense in doing conditional compilation here, and we shouldn&#39;t enable it.</div><div><br></div><div>-- James</div></div></div></div>