3 ms·
The pop_back() error would have been caught easily by an experienced C++ dev as common sense says run with assertions enabled in dev builds(With MSVC use _CONTA
by TinkersW 4y ago
The pop_back() error would have been caught easily by an experienced C++ dev as common sense says run with assertions enabled in dev builds(With MSVC use _CONTAINER_DEBUG_LEVEL =1).
The other error was just dumb using a C function when a good C++ alternative exists.
- Kranar 4y agoDon't know what your domain is, but most experienced devs in most of the domains I work in turn off those assertions because they slow the absolute hell out of debug builds. Like yes, debug builds are naturally slower, but there's slow and there's unbearable, and MSVC's debug checks are simply unbearable. GCC/clang both have a set of reasonable assertions that don't impact performance too much, so if possible I use those to do my testing.
- TinkersW 4y agoNo they don't, you are thinking of older implementations(the old checked iterators _ITERATOR_DEBUG_LEVEL etc in msvc). That shit was indeed very slow. You can run release builds with _CONTAINER_DEBUG_LEVEL =1 and the performance impact is minor.