
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


