<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Thanks for disentangling this, Tim. For some reason, I constantly forget about the Lakos rule.<div class=""><br class=""></div><div class="">I actually think we’d be better off strengthening the `noexcept` to make it unconditional. It’s simpler that way and it’s a conforming extension.<div class=""><br class=""></div><div class="">Louis<br class=""><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Mar 4, 2021, at 12:43, Christopher Di Bella <<a href="mailto:cjdb.ns@gmail.com" class="">cjdb.ns@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="auto" class="">Yeah, I'm fine with that.<div dir="auto" class=""><br class=""></div><div dir="auto" class="">Louis, I can add a comment explaining this instead of a technical patch. WDYT? </div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 4 Mar 2021, 09:41 Tim Song, <<a href="mailto:t.canens.cpp@gmail.com" class="">t.canens.cpp@gmail.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">My interpretation is<br class="">
<br class="">
- the _LIBCPP_STD_VER >= 14 unconditional noexcept is a permissible<br class="">
strengthening relative to the standard's requirement. The conditional<br class="">
noexcept in the standard is a Lakos rule relic because of the UB in<br class="">
<a href="https://timsong-cpp.github.io/cppwp/container.requirements.general#9.sentence-4" rel="noreferrer noreferrer" target="_blank" class="">https://timsong-cpp.github.io/cppwp/container.requirements.general#9.sentence-4</a>.<br class="">
- the _LIBCPP_STD_VER < 14 conditional noexcept is an attempt to<br class="">
support allocators that throw when swapped. Those allocators were<br class="">
banned by LWG2016.<br class="">
<br class="">
So everything is OK as is, but there may be a case for treating<br class="">
LWG2016 as a DR and making this function unconditionally noexcept<br class="">
across all standard versions.<br class="">
<br class="">
On Thu, Mar 4, 2021 at 11:24 AM Christopher Di Bella <<a href="mailto:cjdb.ns@gmail.com" target="_blank" rel="noreferrer" class="">cjdb.ns@gmail.com</a>> wrote:<br class="">
><br class="">
> Ah, I was looking for a big "Resolved" status and missed that.<br class="">
><br class="">
> So IIUC you're saying the conditional noexcept specifier is a relic required by the Lakos rule, but is always true thanks to LWG2016, and an allocator that throws in its swap in libc++ calls std::terminate, which is our resolution to UB, and so everything is already A-OK.<br class="">
><br class="">
> On Thu, 4 Mar 2021, 09:16 Tim Song, <<a href="mailto:t.canens.cpp@gmail.com" target="_blank" rel="noreferrer" class="">t.canens.cpp@gmail.com</a>> wrote:<br class="">
>><br class="">
>> On Thu, Mar 4, 2021 at 11:14 AM Christopher Di Bella <<a href="mailto:cjdb.ns@gmail.com" target="_blank" rel="noreferrer" class="">cjdb.ns@gmail.com</a>> wrote:<br class="">
>> ><br class="">
>> ><br class="">
>> ><br class="">
>> > On Thu, 4 Mar 2021, 09:03 Tim Song, <<a href="mailto:t.canens.cpp@gmail.com" target="_blank" rel="noreferrer" class="">t.canens.cpp@gmail.com</a>> wrote:<br class="">
>> >><br class="">
>> >> I don't think this is an oversight. The conditional noexcept on swap<br class="">
>> >> in the standard is entirely due to the Lakos rule (swapping containers<br class="">
>> >> with non-propagating unequal allocators is undefined), so the<br class="">
>> >> unconditional noexcept is a permissible strengthening. The<br class="">
>> >> __is_nothrow_swappable check pre-17 is presumably to support<br class="">
>> >> allocators with throwing swaps, which were banned by LWG2016.<br class="">
>> >><br class="">
>> >> If a change is desirable, I would suggest treating LWG2016 as a DR and<br class="">
>> >> using unconditional noexcept across the board.<br class="">
>> ><br class="">
>> ><br class="">
>> > I see LWG2016 is P2 and hasn't been looked at since 2017. What would be necessary to get LWG to review this again?<br class="">
>> ><br class="">
>><br class="">
>> It's in C++17 already?<br class="">
</blockquote></div>
</div></blockquote></div><br class=""></div></div></div></body></html>