logoalt Hacker News

cjbgkagh • today at 4:33 PM • 1 reply • view on HN

Not a regular C++ programmer but wouldn’t you use std::span here instead? Sure it’ll carry a few redundant lengths but it makes using functions that take spans easier. When I do write C++ it’s usually for speed so I’m often working at the intrinsics level, though AI has gotten good enough at it that I now generally delegate this work to an agent.


Replies

jandrewrogers • today at 5:07 PM

Depending on the specific code, the compiler may even eliminate the redundant lengths.