ADSP: Algorithms + Data Structures = Programs cover image

Episode 91: C++23 (Part 2)

ADSP: Algorithms + Data Structures = Programs

00:00

Using a Destroyed Erator to Calculate the Output Size

In discarded orators, while it doesn't, you know, store anything, it does keep track of how many times it's been incremented. So if you call ntersection with your two input sets, and then with ha discarde iterator for the output set,. Set intersection will return you a aniterator, a discardIterator. You can get the size of the set intersection, and then you can allocate only that storage. Ah, and that might be useful if you're doing things in peril, because then, if you're oing things in perill on the gpu, the additional cost of doing the computation twice may not be that important. But am a conserving memory

Play episode from 25:01
Transcript

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app