Skip to content

[SYCL] variadic_iterator noexcept #19706

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

Open
wants to merge 2 commits into
base: sycl
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions sycl/source/detail/helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,18 @@ template <typename SyclTy, typename... Iterators> class variadic_iterator {
template <typename IterTy>
variadic_iterator(IterTy &&It) : It(std::forward<IterTy>(It)) {}

variadic_iterator &operator++() {
It = std::visit(
[](auto &&It) {
++It;
return storage_iter{It};
},
It);
variadic_iterator &operator++() noexcept {
std::visit([](auto &&It) noexcept { ++It; }, It);
return *this;
}
bool operator!=(const variadic_iterator &Other) const {
bool operator!=(const variadic_iterator &Other) const noexcept {
return It != Other.It;
}
bool operator==(const variadic_iterator &Other) const {
bool operator==(const variadic_iterator &Other) const noexcept {
return It == Other.It;
}

decltype(auto) operator*() {
decltype(auto) operator*() noexcept {
return std::visit(
[](auto &&It) -> decltype(auto) {
decltype(auto) Elem = *It;
Expand Down
Loading