Skip to content
This repository was archived by the owner on Mar 21, 2024. It is now read-only.

thrust::tuple_size fails for "const thrust::pair<T1,T2>" #1456

Closed
jrhemstad opened this issue Jun 8, 2021 · 1 comment · Fixed by #1457
Closed

thrust::tuple_size fails for "const thrust::pair<T1,T2>" #1456

jrhemstad opened this issue Jun 8, 2021 · 1 comment · Fixed by #1457
Assignees
Labels
P1: should have Necessary, but not critical. type: bug: functional Does not work as intended.
Milestone

Comments

@jrhemstad
Copy link
Collaborator

As seen in this example, thrust::tuple_size< const thrust::tuple<T1, T2>> will fail to compile:

https://godbolt.org/z/M177q6Ye6

This is because tuple_size has a partial specialization for pair<T1,T2>, but not const pair<T1, T2>.

As a result, tuple_size for a const pair will hit the generic template for tuple_size, which is only valid for thrust::tuple types.

@jrhemstad jrhemstad added the type: bug: functional Does not work as intended. label Jun 8, 2021
@jrhemstad
Copy link
Collaborator Author

Same problem with tuple_element: https://godbolt.org/z/37Wj6Wene

@alliepiper alliepiper added this to the 1.13.0 milestone Jun 9, 2021
@alliepiper alliepiper added the P1: should have Necessary, but not critical. label Jun 9, 2021
@alliepiper alliepiper modified the milestones: 1.13.0, 1.14.0 Jun 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P1: should have Necessary, but not critical. type: bug: functional Does not work as intended.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants