Skip to content

Secure Programming Practices: Part 4

Published on

Become familiar with several concepts from the C++ Core Guidelines, including ES.1: Prefer the standard library to other libraries and to “handcrafted code”, Prefer iostreams for I/O, F.53: Avoid capturing by reference in lambdas that will be used nonlocally, including returned, stored on the heap, or passed to another thread, F.54: If you capture ‘this’, capture all variables explicitly (no default capture), Con.2: By default, make member functions const, C.128: Virtual functions should specify exactly one of virtual, override, or final. Test and audit libraries to reduce the risk of security issues. When implementing your own code, it is possible to make it more secure by using the compiler to enforce your intentions.