From bcf66ebce476fab32e92949cfa76a707a1c2bfe8 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Fri, 17 Jan 2020 15:25:27 +0100 Subject: [PATCH] common: drop the unused mutable_item_history container. Signed-off-by: Radoslaw Zarzynski --- src/common/item_history.h | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/src/common/item_history.h b/src/common/item_history.h index bf0b504c546fa..87512a28c52e6 100644 --- a/src/common/item_history.h +++ b/src/common/item_history.h @@ -15,44 +15,6 @@ total lifetime. */ -template -class mutable_item_history { -private: - std::mutex lock; - std::list history; - T *current = nullptr; - -public: - mutable_item_history() { - history.emplace_back(T()); - current = &history.back(); - } - - // readers are lock-free - const T& operator*() const { - return *current; - } - const T *operator->() const { - return current; - } - - // non-const variants (be careful!) - T& operator*() { - return *current; - } - T *operator->() { - return current; - } - - // writes are serialized - const T& operator=(const T& other) { - std::lock_guard l(lock); - history.push_back(other); - current = &history.back(); - return *current; - } -}; - template class safe_item_history { private: -- 2.47.3