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
Is this a duplicate?
Type of Bug
Silent Failure
Component
Thrust
Describe the bug
If the transformation function object of a
thrust::transform_iteratoris not copy_assignable (e.g., if it contains aconstdata member), thenthrust::transform_iteratoris 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