For clarity, there is also ReadData(vector<byte>&&)) for them to move (or make a copy and move) the data in. But if they know the memory is sitting somewhere anyway, they can use the span overload.
Q for #programming twitter:
What is a term that means the lifetime of a resource must exceed the usage of that resource?
ie, a function Thing* ReadData(span<byte>), how do I document to the user that they're required to keep the memory around because Thing still references it?
-
-
Näytä tämä ketjuKiitos. Käytämme tätä aikajanasi parantamiseen. KumoaKumoa
-
Lataaminen näyttää kestävän hetken.
Twitter saattaa olla ruuhkautunut tai ongelma on muuten hetkellinen. Yritä uudelleen tai käy Twitterin tilasivulla saadaksesi lisätietoja.