3 ms·
> I think there really needs to be a "Safe STL" in addition to "Performant STL" that performs range checks. indeed. for gcc, you can compile stuff with '-D_GLI
by signa11 9y ago
> I think there really needs to be a "Safe STL" in addition to "Performant STL" that performs range checks.
indeed. for gcc, you can compile stuff with '-D_GLIBCXX_DEBUG' to enable random-iterator bound checks. moreover, random-access-iterators do have the 'at(...)' stuff available for bounds checked access to the containers.
but, yeah, a standardized way would be very useful.
- pjmlp 9y agoVisual C++ on debug mode also enables iterator validation and bounds checking for arrays and strings. It is also possible to explicitly enable them in release code. https://blogs.msdn.microsoft.com/vcblog/2017/06/28/security-features-in-microsoft-visual-c/ https://blogs.msdn.microsoft.com/vcblog/2017/06/28/security-...