NVIDIA / NVIDIA/cccl

Ensure CTAD works for all thrust iterators

Open
#4,142 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
2.5k
Forks
486
Avg merge
2d 6h
Merged PRs (30d)
295

Description

Constructor Template Argument Deduction (CTAD) allows the compiler to infer a class' template arguments from the invocation of its constructor. This feature was introduced in C++17. The workaround before where `make_class` functions.

Some thrust iterators already support CTAD. E.g. `thrust::counting_iterator it{0}` correctly deduces `counting_iterator`. We should check and add tests that CTAD works for all iterators:

- [ ] constant_iterator.h
- [ ] counting_iterator.h
- [ ] discard_iterator.h
- [ ] offset_iterator.h
- [ ] permutation_iterator.h
- [ ] reverse_iterator.h
- [ ] tabulate_output_iterator.h
- [ ] transform_input_output_iterator.h
- [ ] transform_iterator.h
- [ ] transform_output_iterator.h
- [ ] zip_iterator.h

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.