[libcxx-dev] Sequence container swap noexcept specifiers not-to-spec

Tim Song via libcxx-dev libcxx-dev at lists.llvm.org
Thu Mar 4 09:16:00 PST 2021


On Thu, Mar 4, 2021 at 11:14 AM Christopher Di Bella <cjdb.ns at gmail.com> wrote:
>
>
>
> On Thu, 4 Mar 2021, 09:03 Tim Song, <t.canens.cpp at gmail.com> wrote:
>>
>> I don't think this is an oversight. The conditional noexcept on swap
>> in the standard is entirely due to the Lakos rule (swapping containers
>> with non-propagating unequal allocators is undefined), so the
>> unconditional noexcept is a permissible strengthening. The
>> __is_nothrow_swappable check pre-17 is presumably to support
>> allocators with throwing swaps, which were banned by LWG2016.
>>
>> If a change is desirable, I would suggest treating LWG2016 as a DR and
>> using unconditional noexcept across the board.
>
>
> I see LWG2016 is P2 and hasn't been looked at since 2017. What would be necessary to get LWG to review this again?
>

It's in C++17 already?


More information about the libcxx-dev mailing list