Skip to content

parallelFor, forAllRanged: take the progress callback by const reference - #7151

Merged
Fedr merged 1 commit into
masterfrom
parallel-for-cb-const-ref
Oct 15, 2026
Merged

Fedr merged 1 commit into
masterfrom
parallel-for-cb-const-ref

Conversation

@Fedr

@Fedr Fedr commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

parallelFor( ..., ProgressCallback cb, size_t reportProgressEvery ) and BitSetParallel::forAllRanged( ..., ProgressCallback progressCb, size_t reportProgressEveryBit ) took the callback by value, so every ParallelFor / BitSetParallelFor call with a named callback copied the std::function. They now take const ProgressCallback&, like reportProgress since #7145.

The ParallelFor / BitSetParallelFor templates forward the callback unchanged, so call sites are unaffected: temporaries such as subprogress( cb, a, b ) and lambdas bind to the reference.

Checked locally: MRMesh builds with MSVC, no warnings.

🤖 Generated with Claude Code

Avoids copying the std::function on every call made with a named callback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Fedr
Fedr merged commit 6973e10 into master Oct 15, 2026
59 checks passed
@Fedr
Fedr deleted the parallel-for-cb-const-ref branch October 15, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants