diff --git a/pool.hpp b/pool.hpp index b863508a..4be5b764 100644 --- a/pool.hpp +++ b/pool.hpp @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2011-2016 Danny Robson + * Copyright 2011-2019 Danny Robson */ #pragma once @@ -50,7 +50,23 @@ namespace cruft { pool (const pool&) = delete; pool& operator= (const pool&) = delete; - pool (pool&&) noexcept; + pool (pool &&rhs) noexcept + : m_head (nullptr) + , m_next (nullptr) + , m_capacity (0) + , m_size (0) + { + std::swap (m_head, rhs.m_head); + + m_next = rhs.m_next.load (); + rhs.m_next = nullptr; + + std::swap (m_capacity, rhs.m_capacity); + + m_size = rhs.m_size.load (); + rhs.m_size = 0; + } + pool& operator= (pool&&); explicit