Tbh if you aren’t already using someone else’s array implementation that includes length information, just write your own simple wrapper e.g.
struct MyArrayWrapper { int *data; int length; }
At that point I would just use std::span if you can, then you also get the standard container/iterator interfaces for free.
The center for all discussion and news regarding C++.
Tbh if you aren’t already using someone else’s array implementation that includes length information, just write your own simple wrapper e.g.
At that point I would just use std::span if you can, then you also get the standard container/iterator interfaces for free.