Bregma, yes. You're absolutely right. My comment is just for this situation (read a fixed-size buffer from a C library, do something like writing it to a file and free the buffer), where it is most unlikely that resizing or your off-the-shelf-C++-standard-library-algorithms are required. But how often do you sort() or erase_if() your pixel buffer data? It is most likely that the data will either be written directly to an image file or processed for post-effects. In that case there is really no advantage in using a full-fledged container.
I never said using vectors for anything but this general use case was a bad idea. I didn't say so, because this would in fact be seriously stupid.
Show differencesHistory of post edits
#1rnlf
Posted 27 August 2012 - 05:26 AM
Bregma, yes. You're absolutely right. My comment is just for this situation (read a fixed-size buffer from a C library, do something like writing it to a file and free the buffer), where it is most unlikely that resizing or your off-the-shelf-C++-standard-library-algorithms are required. But how often do you sort() or erase_if() your pixel buffer data? It is most likely that the data will either be written directly to an image file or processed for post-effects. In that case there is really no advantage in using a full-fledged container.