Skip to content

Replace dispatch_HammingComputer with with_HammingComputer#5126

Closed
mdouze wants to merge 1 commit into
facebookresearch:mainfrom
mdouze:export-D101350351
Closed

Replace dispatch_HammingComputer with with_HammingComputer#5126
mdouze wants to merge 1 commit into
facebookresearch:mainfrom
mdouze:export-D101350351

Conversation

@mdouze
Copy link
Copy Markdown
Contributor

@mdouze mdouze commented Apr 20, 2026

Summary:
Replace the dispatch_HammingComputer + Run_XXX consumer struct pattern with
with_HammingComputer that takes a C++20 template lambda directly. This
eliminates boilerplate wrapper structs across 8 files.

Before:
struct Run_foo { using T = void; template<class HC, class... T> void f(T... a) { foo(a...); } };
Run_foo r; dispatch_HammingComputer(code_size, r, args...);

After:
with_HammingComputer(code_size, [&]() { foo(args...); });

Reviewed By: algoriddle

Differential Revision: D101350351

Summary:
Replace the dispatch_HammingComputer + Run_XXX consumer struct pattern with
with_HammingComputer that takes a C++20 template lambda directly. This
eliminates boilerplate wrapper structs across 8 files.

Before:
  struct Run_foo { using T = void; template<class HC, class... T> void f(T... a) { foo<HC>(a...); } };
  Run_foo r; dispatch_HammingComputer(code_size, r, args...);

After:
  with_HammingComputer(code_size, [&]<class HC>() { foo<HC>(args...); });

Reviewed By: algoriddle

Differential Revision: D101350351
@meta-cla meta-cla Bot added the CLA Signed label Apr 20, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented Apr 20, 2026

@mdouze has exported this pull request. If you are a Meta employee, you can view the originating Diff in D101350351.

@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented Apr 20, 2026

This pull request has been merged in e23c661.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant