From bf471e4e6d2502bb3b4e2eb4b1309d87e1003070 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 1 Dec 2022 11:52:33 +0100 Subject: Add and use SPL::swap(). --- src/lib/spl.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/lib') diff --git a/src/lib/spl.h b/src/lib/spl.h index 49eb93df2..d7c746d1e 100644 --- a/src/lib/spl.h +++ b/src/lib/spl.h @@ -26,6 +26,8 @@ #include "spl_entry.h" #include #include +#include + class ContentStore; @@ -63,6 +65,8 @@ public: SPLEntry const & operator[] (std::size_t index) const { return _spl[index]; + void swap(size_t a, size_t b) { + std::iter_swap(_spl.begin() + a, _spl.begin() + b); } void read (boost::filesystem::path path, ContentStore* store); -- cgit v1.2.3