<div dir="auto"><div><div class="gmail_extra"><div class="gmail_quote">On 9 Oct 2017 09:36, &quot;Nelson, Clark&quot; &lt;<a href="mailto:clark.nelson@intel.com">clark.nelson@intel.com</a>&gt; wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text">&gt;       &gt; After a while pondering, the best example I&#39;ve got to<br>
&gt; demonstrate a<br>
&gt;       &gt; need for the feature test macro is something like this:<br>
&gt;       &gt;<br>
&gt;       &gt; #ifdef __cpp_mandatory_copy_elision<br>
&gt;       &gt;<br>
&gt;       &gt; NoCopyNoMove indirectFactory() {<br>
&gt;       &gt;   return factory(1); // ill-formed prior to C++17<br>
&gt;       &gt; }<br>
&gt;       &gt; #endif<br>
&gt;<br>
</div><div class="quoted-text">&gt;       Should SD-6 contain an example like this one? It seems to me<br>
&gt; that there ought to be a different definition of indirectFactory<br>
&gt; under an #else, but I don&#39;t know what it should look like.<br>
&gt;<br>
&gt;<br>
&gt; For this example, depending on the intent of the library author it<br>
&gt; may be impossible to provide an alternate definition. The feature<br>
&gt; test macro allows this portion of the interface to be omitted if it&#39;s<br>
&gt; nonessential.<br>
<br>
</div>I just want to be sure I understand what you&#39;re thinking, which (I think) is this:<br>
<br>
&quot;indirectFactory&quot;, which is a library function, should be available only when copy elision is guaranteed. Code that doesn&#39;t need guaranteed copy elision will just use &quot;factory&quot; instead.</blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">I think I would say: code that wants to be compilable with older implementations will just use &quot;factory&quot; instead (and auto&amp;&amp; when needed).</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Code that does depend on guaranteed copy elision will just (try to) use &quot;indirectFactory&quot;, and get an error if compiled on an implementation doesn&#39;t provide guaranteed copy elision.</blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">Code that really needs to use indirectFactory, or wants to use it and doesn&#39;t care about supporting older compilers, will just use it and get an error on older compilers.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">So there&#39;s no need for uses of &quot;indirectFactory&quot; to be conditioned on the macro: using it implies that guaranteed copy elision is required.<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">Right.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Is that right?<br>
<font color="#888888"><br>
Clark<br>
</font></blockquote></div><br></div></div></div>