ericniebler / range-v3

Range library for C++14/17/20, basis for C++20's std::ranges
Other
4.11k stars 440 forks source link

Relax indirect callable constraints #1706

Open jehelset opened 2 years ago

jehelset commented 2 years ago

Introduces a new indirect-callable-trait called indirect_value_t to ensure correct value-type computation for algorithms that take projections. Instead of forming a reference to the invoke-result of the projection, it now computes the invoke-result of the projection with a reference to the iterators value-type.

Projections are discriminated from iterators by the existence of a nested typedef indirect_value_type.

More details here: https://jehelset.gitlab.io/cpp/relaxing-ranges-just-a-smidge/

I was a bit unsure what was the idiomatic way to check for the existence of a nested member-type in ranges-v3.