Skip to content

Commit

Permalink
channel: explicitly delete some move/copy constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
sebsura authored and BareosBot committed Sep 22, 2023
1 parent 1ccfc12 commit 244c621
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions core/src/lib/channel.h
Expand Up @@ -72,13 +72,14 @@ template <typename T> class queue {
: locked{std::move(locked)}, update(update)
{
}
handle(const handle&) = delete;
handle& operator=(const handle&) = delete;
handle(handle&&) = delete;
handle& operator=(handle&&) = delete;

std::vector<T>& data() { return locked->data; }

~handle()
{
if (update) { update->notify_one(); }
}
~handle() { update->notify_one(); }
};

/* the *_lock functions return std::nullopt only if the channel is closed
Expand Down

0 comments on commit 244c621

Please sign in to comment.