On Thu, 27 Jun 2019 at 09:54, Alexander Grund via Boost < boost@lists.boost.org> wrote:
Am 27.06.19 um 08:45 schrieb degski via Boost:
As from C++11 std::swap is marked noexcept, so yes. As from C++20 it's also constexpr, so now it can definitely cannot throw.
degski Are you sure? According to https://en.cppreference.com/w/cpp/algorithm/swap this is only non-throwing if it can be moved without throwing
Yes, but std::swap must also not invalidate any references, pointers, or iterators referring to the elements of the containers being swapped, which leaves the scope for throwing rather small [if at all possible]. degski -- @realdegski https://edition.cnn.com/interactive/2019/06/middleeast/saudi-teen-death-pena... "Anyone who believes that exponential growth can go on forever in a finite world is either a madman or an economist" - Kenneth E. Boulding