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 Mar 8, 2024
1 parent dc2d46d commit 6479026
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;
FORCE_INLINE bool next(Iterator &pos) {
Expand All @@ -336,6 +341,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 6479026

Please sign in to comment.