0

I'm annoyed by how C++' standard library only offers some functionality via pointers rather than structures which keep both an address and a size. Specifically, suppose I want something like a unique_ptr<T[]>, but which keeps the associated length/size.

This is not that hard to implement (especially if I avoid the need to distinguish between array and non-array template parameters like in make_unique()); but - what should I call this unique-ptr-with-size ? I was thinking of unique_span or unique_region... or maybe there is some other name that's more appropriate, or more popular, for this structure?

Note: It doesn't seem to be any of the vector-like constructs listed in this table.

einpoklum
  • 118,144
  • 57
  • 340
  • 684

0 Answers0