Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> The C++ compiler needs to provide robust compile-time and run-time checks to tell programmers that things are wrong, like: “your operator does not meet the requirements of the sort algorithm”.

MSVC does that in debug mode - it will assert if you use an invalid comparator for e.g. map / set. No reason it couldn't be further improved, or a clang-tidy check written for that.



MSVC also does interator validation and bounds checking in debug mode, alongside its macro based contracts.

Some things are actually more productive in MS land for security conscious coding. A nice side effect from all those Windows 9X exploits.


It has saved my behind a handful of times. Also shoutout to unordered_map for the debug build runtime check that equal keys have equal hashes.


(just by pure curiosity, are you Vesa Norilo ? if so, great work on Kronos !)


That's me! Thank you, much appreciated.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: