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

thrust::device_vector should have an std::initializer_list constructor #1835

Closed
Eren121 opened this issue Dec 3, 2022 · 1 comment · Fixed by #1836
Closed

thrust::device_vector should have an std::initializer_list constructor #1835

Eren121 opened this issue Dec 3, 2022 · 1 comment · Fixed by #1836

Comments

@Eren121
Copy link
Contributor

Eren121 commented Dec 3, 2022

Currently, its not possible to do:

thrust::device_vector<int> v{4, 8, 0, 8, 4, 2, 8};

But instead we need to do:

thrust::device_vector<int> v{std::vector<int>{4, 8, 0, 8, 4, 2, 8}};

Because there are no constructor taking a std::initializer_list, unlike std::vector.

Could it be possible to add this?

This shoud be straightforward to add, using other constructors.

@miscco
Copy link
Collaborator

miscco commented Dec 5, 2022

@Eren121 thanks for reporting this. I have opened a PR that should alleviate the issue

@github-project-automation github-project-automation bot moved this to Done in CCCL Feb 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants