C++: Using Smart Pointers with Arrays

The modern C++ standard libraries, includes smart pointers, which are used to help ensure that programs are free of memory and resource leaks and are exception-safe. All good and sweet, but these structures have a dark little secret. You may ask yourself how do smart pointers choose between delete and delete[] when deleting the managed … Continue reading C++: Using Smart Pointers with Arrays

The dangerous pointer to vector

This is actually a really obvious "issue" but I found that some developers (usually the inexperienced ones) simply don't think about this horrible source of bugs:). Now let's see the problem: https://gist.github.com/arpytoth/f8a43578f39de7ab378e If you run the code snipped above you will see an output similar to: The value of our int is: 1 The value … Continue reading The dangerous pointer to vector