[ENHANCEMENT]: Provide helper function cuco::experimental::make_static_set et al
Nobody has claimed this yet.
- Dominant language
- Cuda
- Stars
- 667
- Forks
- 120
- Avg merge
- 7d 5h
- Merged PRs (30d)
- 4
Description
Is your feature request related to a problem? Please describe.
I would like a function called make_static_set that will create a static set that will infer the template arguments from the function call.
Describe the solution you'd like
Instead of:
auto set = cuco::experimental::static_set<MyKeyType, MyExtent, MyThreadScope, MyKeyEqual>(capacity, cuco::empty_key(-1), MyKeyEqual(123));
I could write:
auto set = cuco::experimental::make_static_set(capacity, cuco::empty_key(-1), MyKeyEqual(123));
Notice how it's much smaller and I'm not repeating myself. Notice the addition of the work "make". This is consistent with the stdlib's usage of the word make in, for example, std::make_tuple
Describe alternatives you've considered
I can do without but its wordy. Doing this doesn't add much work for cuco. Cuco can modify some of its tests to use this form of the instantiation so that it is tested well in CI.
Additional context
Inference only works on functions, not classes: https://stackoverflow.com/questions/797594/when-a-compiler-can-infer-a-template-parameter
Here's how make_tuple works: https://en.cppreference.com/w/cpp/utility/tuple/make_tuple
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the cuco::experimental::static_set implementation and its existing tests. Check how the proposed make_static_set call should infer the template arguments, then update tests to exercise the helper and confirm the requested construction form works in CI.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100