C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Laundering arrays of unknown bound

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Sun, 3 Apr 2022 09:21:28 -0400
I don't believe this is necessary. While `T` may not be implicit
lifetime, arrays of `T` are. So if your allocator returns a `T*`, if
the caller uses that `T*` in a way that would require that `T*` to be
a pointer into an array of `T`, the system will create that array
around the pointer and declare that the pointer was always a pointer
to an array of `T`.

It does this without creating the `T` elements of the array.

Received on 2022-04-03 13:21:41