NVIDIA / NVIDIA/cccl

Return value of thrust::minmax_element differs from STL's minmax_element

Open
#699 2 comments 0 reactions 1 assignee Claimed by @brycelelbach View on GitHub
thrust
Dominant language
C++
Stars
2.5k
Forks
486
Avg merge
2d 6h
Merged PRs (30d)
295

Description

In both STL and thrust a call to `minmax_element` returns a pair of iterators, the first points to the minimum and the second to the maximum value. In both STL and thrust, if more than run minimum exists, the first value is chosen. If more than one maximum value exists, the STL version chooses the last candidate while thrust chooses the first one. While I think the STL is quite inconsistent here, I'd still prefer if thrust would behave just like the STL

Best wishes,
maribu

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.