Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: thrust::transform_iterator<F, ...> is broken if F is not copy_assignable #2393

Open
1 task done
Tracked by #101
bernhardmgruber opened this issue Sep 9, 2024 · 0 comments · May be fixed by #3395
Open
1 task done
Tracked by #101

[BUG]: thrust::transform_iterator<F, ...> is broken if F is not copy_assignable #2393

bernhardmgruber opened this issue Sep 9, 2024 · 0 comments · May be fixed by #3395
Assignees
Labels
bug Something isn't working right.

Comments

@bernhardmgruber
Copy link
Contributor

Is this a duplicate?

Type of Bug

Silent Failure

Component

Thrust

Describe the bug

If the transformation function object of a thrust::transform_iterator is not copy_assignable (e.g., if it contains a const data member), then thrust::transform_iterator is still copyable, but it will just omit copying the contained transformation function. If the latter contains state, than this state is not copied and the transform iterator gives wrong results.

How to Reproduce

Godbolt: https://godbolt.org/z/qbGxh31qE

Expected behavior

thrust::transform_iterator's special member functions should fail to compile if the corresponding special member function is not supported on the wrapped user-provided function. If the latter is not copyable assignable, the transform iterator should also fail to compile if copy assignment is attempted.

Reproduction link

No response

Operating System

No response

nvidia-smi output

No response

NVCC version

No response

@bernhardmgruber bernhardmgruber added the bug Something isn't working right. label Sep 9, 2024
@github-project-automation github-project-automation bot moved this to Todo in CCCL Sep 9, 2024
@bernhardmgruber bernhardmgruber self-assigned this Oct 30, 2024
bernhardmgruber added a commit to bernhardmgruber/cccl that referenced this issue Jan 15, 2025
@bernhardmgruber bernhardmgruber linked a pull request Jan 15, 2025 that will close this issue
@cccl-authenticator-app cccl-authenticator-app bot moved this from Todo to In Review in CCCL Jan 15, 2025
bernhardmgruber added a commit to bernhardmgruber/cccl that referenced this issue Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working right.
Projects
Status: In Review
Development

Successfully merging a pull request may close this issue.

1 participant