Skip to content

Design: Why are array inputs to Block-Algorithms not const #1288

Answered by gevtushenko
pauleonix asked this question in CUB
Discussion options

You must be logged in to vote

Hello @pauleonix!

I agree, it should be const. I can speculate that the initial reason was to allow binary operator to accept non-const lvalues. We probably need something along the lines of std::reduce in our docs as well:

The behavior is undefined if binary_op modifies any element

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@pauleonix
Comment options

@gevtushenko
Comment options

Answer selected by pauleonix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
CUB
Labels
None yet
2 participants