Left associativity is already guaranteed by C++ core semantics:
R|V1|V2
is parsed as (R|V1)|V2)
. What if the coder wants to explicitly change the order of operations to R|(V1|V2)
?
Is this possible under C++23?
The reason behind the question is that it simplifies defining custom range adapters:
auto myV=V1|V2|V3;
for(auto& x:R1|myV)/*..*/;
for(auto& x:R2|myV)/*..*/;
All this needs seems to be a properly constraint overload on std::views::operator|
;
Does such overload exist?
If not, will it be added?
If not, what's the rationale behind it?