hpx icon indicating copy to clipboard operation
hpx copied to clipboard

Proxy support for find algorithms

Open K-ballo opened this issue 6 months ago • 1 comments

The find family of algorithms does not support proxy reference types, as it expects dereferencing an iterator yields an lvalue here:

https://github.com/STEllAR-GROUP/hpx/blob/dcf267d7868a0deab2e6f746ca5be8dad6553eea/libs/core/algorithms/include/hpx/parallel/algorithms/detail/find.hpp#L50

and a few other similar places.

The fix is to perfectly forward v.

K-ballo avatar Jun 12 '25 12:06 K-ballo

Excellent catch!

hkaiser avatar Jun 12 '25 13:06 hkaiser

Hi, I believe this issue was resolved by PR #6753 Please take a look.

ArivoliR avatar Oct 24 '25 17:10 ArivoliR

Hi, I believe this issue was resolved by PR #6753 Please take a look.

Do we have a test for this?

hkaiser avatar Oct 24 '25 22:10 hkaiser

Hi @hkaiser, The PR I mentioned does not add any new tests for this change. I wasn’t sure about the best way to write a test for this case. Could you please guide me on how to add one, or point me to an existing test that I can model it after?

Would libs/core/algorithms/tests/unit/algorithms/find.cpp be a good reference to look at?

ArivoliR avatar Oct 25 '25 09:10 ArivoliR

The easiest would probably be a test that involves iterators provided from std::vector<bool>.

hkaiser avatar Oct 25 '25 19:10 hkaiser

Currently working on the PR, I’ll update you soon

ArivoliR avatar Oct 27 '25 19:10 ArivoliR