I noticed that the std::vector
container's swap function has a different noexcept-specification than all other containers. Specifically, the function is noexcept if the expression
std::allocator_traits<Allocator>::propagate_on_container_swap || std::allocator_traits<Allocator>::is_always_equal
is true, but other containers require only the expression std::allocator_traits<Allocator>::is_always_equal
to be true.
Since the behavior of the swap functions is the same, why is the noexcept-specification different in just the std::vector
container?