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 committed Nov 22, 2023
1 parent d654801 commit abef3da
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 @@ -319,6 +319,11 @@ template <class OuterLoopType> struct ThreadedLoopRunOuter {
ProgressBar::SwitchToMultiThreaded progress_functions;

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

struct PerThread {
PerThread() = delete;
PerThread(const PerThread &) = default;
PerThread(PerThread &&) = default;
PerThread &operator=(const PerThread &) = delete;
PerThread &operator=(PerThread &&) = delete;
Shared &shared;
typename std::remove_reference<Functor>::type func;
void execute() {
Expand Down

0 comments on commit abef3da

Please sign in to comment.