From c3d6046b25ef0786b8d2919dfa9db4eb05114501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sun, 21 Feb 2021 22:16:21 +0100 Subject: Sync service --- include/erebos/storage.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include/erebos/storage.h') diff --git a/include/erebos/storage.h b/include/erebos/storage.h index 75b8139..7ec73ab 100644 --- a/include/erebos/storage.h +++ b/include/erebos/storage.h @@ -507,12 +507,16 @@ class WatchedHead : public Head friend class Head; WatchedHead(const Head & h, int watcherId): Head(h), watcherId(watcherId) {} + int watcherId; + +public: WatchedHead(WatchedHead && h): Head(h), watcherId(h.watcherId) { h.watcherId = -1; } - int watcherId; -public: + WatchedHead & operator=(WatchedHead && h) + { watcherId = h.watcherId; h.watcherId = -1; return *this; } + WatchedHead & operator=(const Head & h) { if (Head::id() != h.id()) throw std::runtime_error("WatchedHead ID mismatch"); -- cgit v1.2.3