
6 Dec
2024
6 Dec
'24
8:35 p.m.
Correct, and that's why you `first<N>()` after, however the question is how
effective the compiler is at eliminating this temporary in between.
Claudio.
On Fri, Dec 6, 2024 at 7:07 PM Peter Dimov via Boost
Claudio DeSouza wrote:
The compiler can still see the max value being passed in and your example block has a fixed extent. By using first<> you get another span of fixed extent.
block has a fixed extent, but block.subspan(i * 4) does not.
...
On 12/6/24 21:46, Claudio DeSouza via Boost wrote:
detail::read32le( block.subspan(i * 4).first<4>());
So you also get a sized span, and avoid checks.
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost