C++: “auto” on anonymous functions

C++14 introduced an improvement to the way we can declare anonymous functions (a.k.a. lambda expressions). For example, before C++14, if you wanted to pass an anonymous function to the sort algorithm, you had to do something like this: Since C++14, you can let the compiler to deduce the type of the variables passed as parameters…… Continue reading C++: “auto” on anonymous functions

C++: Smart pointers, part 5: weak_ptr

This is the last of several posts I wrote related to smart pointers: Smart pointers unique_ptr More on unique_ptr shared_ptr weak_ptr In modern C++ applications (C++11 and later), you can replace almost all your naked pointers to shared_ptr and unique_ptr in order to have automatic resource administration in a deterministic way so you will not…… Continue reading C++: Smart pointers, part 5: weak_ptr