<div dir="ltr"><div dir="ltr">On Mon, Sep 9, 2019 at 9:37 PM Richard Smith &lt;<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>&gt; wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Good point. Determining whether you can mark functions as constexpr seems like a reasonable motivation for at least try/catch and changing the active union member. Probably also for virtual function calls. How many feature test macros do we want? (Clang already implemented all of these, so we&#39;ll start advertising them all in the same release and don&#39;t need separate macros; I don&#39;t know about other implementations.)</div></blockquote><div><br></div><div>This is good question to answer. In the nodiscard conversation, Wakely suggested having a specific nodiscard_reason macro even if we are already bumping the nodiscard value (<a href="http://www.open-std.org/pipermail/features/2019-August/000628.html">http://www.open-std.org/pipermail/features/2019-August/000628.html</a>), because it&#39;s more convenient for users.</div><div><br></div>In this case, would having granular macros help? I guess we&#39;d write:</div><div class="gmail_quote"><span style="font-family:monospace"><br></span></div><div class="gmail_quote"><span style="font-family:monospace">#if __cpp_constexpr_union_assign</span></div><div class="gmail_quote"><span style="font-family:monospace">constexpr</span></div><div class="gmail_quote"><span style="font-family:monospace">#endif</span></div><div class="gmail_quote"><span style="font-family:monospace">optional&amp; operator=(nullopt_t) noexcept;</span></div><div class="gmail_quote"><br></div><div class="gmail_quote">and is going to be more user friendly than</div><div class="gmail_quote"><br></div><div class="gmail_quote"><span style="font-family:monospace">#if __cpp_constexpr &gt; whatwasthatnumberagain</span></div><div class="gmail_quote"><span style="font-family:monospace">constexpr</span></div><div class="gmail_quote"><span style="font-family:monospace">#endif</span></div><div class="gmail_quote"><br></div><div class="gmail_quote">and both probably easier to understand than<br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><span style="font-family:monospace">#if __cpp_constexpr &gt; whatever</span></div><div class="gmail_quote"><span style="font-family:monospace">#define CONSTEXPR_UNION_TRY_POLY constexpr</span></div><div class="gmail_quote"><span style="font-family:monospace">#else</span></div><div class="gmail_quote"><span style="font-family:monospace">#define CONSTEXPR_UNION_TRY_POLY</span></div><div class="gmail_quote"><span style="font-family:monospace">#endif</span></div><div class="gmail_quote"><span style="font-family:monospace"><br></span></div><div class="gmail_quote"><span style="font-family:monospace">CONSTEXPR_UNION_TRY_POLY optional&amp; operator=(nullopt_t) noexcept;</span></div><div class="gmail_quote"><br></div><div class="gmail_quote">although there&#39;s probably some clever preprocessor way of writing</div><div class="gmail_quote"><br></div><div class="gmail_quote"><span style="font-family:monospace">CONSTEXPR(thatvalue) optional&amp; operator=(nullopt_t) noexcept;</span></div><div class="gmail_quote"><br></div><div class="gmail_quote">which wouldn&#39;t be so bad?</div><div class="gmail_quote"><br></div><div class="gmail_quote">Barry<br></div></div>