Skip to content

Commit

Permalink
ThreadedLoop: fix rule-of-5 issue highlighted by clang-tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
jdtournier authored and daljit46 committed Feb 19, 2024
1 parent a7ee4ab commit 9ee103e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions core/algo/threaded_loop.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,11 @@ template <class OuterLoopType> struct ThreadedLoopRunOuter {
ProgressBar::SwitchToMultiThreaded progress_functions;

struct Shared {
Shared(const Shared &) = delete;
Shared(Shared &&) = delete;
Shared &operator=(const Shared &) = delete;
Shared &operator=(Shared &&) = delete;
~Shared() = default;
Iterator &iterator;
decltype(outer_loop(iterator)) loop;
std::mutex &mutex;
Expand All @@ -338,6 +343,11 @@ template <class OuterLoopType> struct ThreadedLoopRunOuter {

struct PerThread {
MutexProtected<Shared> &shared;
PerThread(const PerThread &) = default;
PerThread(PerThread &&) = default;
PerThread &operator=(const PerThread &) = delete;
PerThread &operator=(PerThread &&) = delete;
~PerThread() = default;
typename std::remove_reference<Functor>::type func;
void execute() {
auto pos = shared.lock()->iterator;
Expand Down

0 comments on commit 9ee103e

Please sign in to comment.