<div dir="ltr"><div>I've noticed that our sequence containers' noexcept specifiers for swap aren't to spec. Is this intentional, or some gross oversight?</div><div><br></div><div>Example from <vector></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">    void swap(vector&)<br>#if _LIBCPP_STD_VER >= 14<br>        _NOEXCEPT;<br>#else<br>        _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||<br>                    __is_nothrow_swappable<allocator_type>::value);<br>#endif</span></div><div><br></div><div>To me, this looks like it's saying that swap is unconditionally noexcept in C++17 and C++20, and possibly the opposite of [vector.capacity]/12 otherwise?<br></div><div><br></div><div><a href="http://eel.is/c++draft/vector#capacity-12">[vector.capacity]/12</a> notes:</div><div><br></div><div><span style="font-family:monospace">constexpr void swap(vector& x)<br>  noexcept(allocator_traits<Allocator>::propagate_on_container_swap::value ||<br>           allocator_traits<Allocator>::is_always_equal::value);</span></div><div><br></div><div>If this is an oversight, I'll file a bug and patch ASAP. If it's intentional, is it explicitly documented somewhere to explain the deviation? This was a surprise when writing tests for <span style="font-family:monospace">std::ranges::swap</span>'s noexcept status.<br></div><div><br></div><div>Cheers,</div><div><br></div><div>Chris</div><div><br></div><div>P.S. I've scoped this to sequence containers for now, but it might be all allocator-aware containers.<br></div></div>