You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An rvalue span does not work for algorithms that modify elements. In the following example, using an lvalue span works, but using an rvalue span fails to compile.
It looks to me that the issue is that boost::begin and boost::end have overloads for lvalue ranges and const lvalue ranges but not rvalue ranges, so if you pass an rvalue range to an algorithm, it gets treated as a const lvalue range and has const iterators. That seems to be the right thing to do for containers, but not so much for proxy types like span.
The text was updated successfully, but these errors were encountered:
An rvalue span does not work for algorithms that modify elements. In the following example, using an lvalue span works, but using an rvalue span fails to compile.
It looks to me that the issue is that
boost::begin
andboost::end
have overloads for lvalue ranges and const lvalue ranges but not rvalue ranges, so if you pass an rvalue range to an algorithm, it gets treated as a const lvalue range and has const iterators. That seems to be the right thing to do for containers, but not so much for proxy types like span.The text was updated successfully, but these errors were encountered: