Nested type detector fails for reference types
Open
thrust
- Dominant language
- C++
- Stars
- 2.5k
- Forks
- 487
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 296
Description
While debugging https://github.com/NVIDIA/cccl/issues/792 I found that a transform_iterator with a reference `result_type` would fail:
https://godbolt.org/z/o6aTaE8Tz
I traced this down to the fact that `thrust::detail::has_result_type` fails with reference `result_type`s:
https://godbolt.org/z/b1d8PMjbq
This stems from an implementation of a member type detector that won't work for references: https://github.com/NVIDIA/thrust/blob/d35f44f36fc4730605d39abdfac92f500ff44a55/thrust/detail/type_traits/has_nested_type.h#L21-L31
This member type detector implementation should be updated to be more general.
Contributor guide
Assessment
This issue has not been assessed yet.