From c96712248487fa84625b3265b3966c1620608555 Mon Sep 17 00:00:00 2001 From: Fritz Obermeyer Date: Sun, 5 Nov 2017 20:04:26 -0800 Subject: [PATCH] Fixes for Ubuntu 1604 --- include/distributions/timers.hpp | 2 +- include/distributions/vector.hpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/distributions/timers.hpp b/include/distributions/timers.hpp index 8be8a94..5c3497a 100644 --- a/include/distributions/timers.hpp +++ b/include/distributions/timers.hpp @@ -25,7 +25,7 @@ // TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# pragma once +#pragma once #include #include diff --git a/include/distributions/vector.hpp b/include/distributions/vector.hpp index 5e49fdd..1a38a9b 100644 --- a/include/distributions/vector.hpp +++ b/include/distributions/vector.hpp @@ -46,7 +46,9 @@ struct Packed_ : std::vector { void packed_remove(size_t pos) { DIST_ASSERT1(pos < Base::size(), "bad pos: " << pos); - Base::operator[](pos) = std::move(Base::back()); + if (pos != Base::size() - 1) { + Base::operator[](pos) = std::move(Base::back()); + } Base::pop_back(); }