Skip to content
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

[tests] Fix for permutation_iterator tests with transform_iterator index #1489

Merged
Merged
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
24 changes: 12 additions & 12 deletions test/parallel_api/iterator/permutation_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,22 +197,22 @@ struct test_through_permutation_iterator<TSourceIterator, TSourceDataSize, perm_
{
}

using ValueType = typename ::std::iterator_traits<TSourceIterator>::value_type;

// Using callable object instead of lambda here to ensure transform iterator would be
// default constructible, that is part of the Forward Iterator requirements in the C++ standard.
struct NoTransform
{
ValueType operator()(const ValueType& val) const
{
return val;
}
};

template <typename Operand>
void
operator()(Operand op)
{
using ValueType = typename ::std::iterator_traits<TSourceIterator>::value_type;

// Using callable object instead of lambda here to ensure transform iterator would be
// default constructible, that is part of the Forward Iterator requirements in the C++ standard.
struct NoTransform
{
ValueType operator()(const ValueType& val) const
{
return val;
}
};

auto indexes_begin = dpl::counting_iterator<TSourceDataSize>(0);
auto itTransformBegin = dpl::make_transform_iterator(indexes_begin, NoTransform{});
auto permItBegin = dpl::make_permutation_iterator(data.itSource, itTransformBegin);
Expand Down
Loading