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

Classify chunk_size_iterator to input iterator tag. (Fix #2866) #2932

Merged
merged 1 commit into from Oct 12, 2017

Conversation

taeguk
Copy link
Member

@taeguk taeguk commented Oct 6, 2017

This PR fixes #2866 .

Now, I classify chunk_size_iterator to input_iterator_tag, not forward_iterator_tag.
What I worry is that if chunk_size_iterator will be used incorrectly in any place, he/she may not know what is incorrect and wander with mistery bug.

template <typename Executor, typename F, typename Shape, typename ... Ts>
HPX_FORCEINLINE auto
bulk_async_execute(Executor && exec, F && f, Shape const& shape,
Ts &&... ts)
-> decltype(bulk_async_execute_fn_helper<
typename std::decay<Executor>::type
>::call(std::forward<Executor>(exec), std::forward<F>(f),
shape, std::forward<Ts>(ts)...
))

For example, in above code, there is a nothing which explicitly notices that chunk_size_iterator is input iterator.
So, an user who utilizes chunk_size_iterator "indirectly" can make a mistake which violates multi-pass gaurantee.

Copy link
Member

@hkaiser hkaiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@hkaiser hkaiser merged commit d711115 into STEllAR-GROUP:master Oct 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The chunk_size_iterator violates multipass guarantee.
2 participants