-
Reading static libraries
The journey of reading library binaries To answer these questions we will start by creating a small library with one function. After we have the micro library. we will examine it and see if we can find the single defined function. Library Source Layout CMakeLists.txt Note: Just to be clear having a CMakeLists for this…
-
Builder for C++ Resource Class
This is a useful pattern people should use in cpp One problem with cpp classes is the method for communicating failures in a constructor. Imagine a class that acquire a resource. Such as: What if the acquisition fails? Will the user know? An acquisition internal to the constructor failing would leave the object in a…
-
Move Only Class
Make interfaces easy to use correctly and hard to use incorrectly.” — Scott Meyers Disclaimer In Cpp there are a couple of patterns that are recommended ideas for handling resources. One of them is using move only classes. Move only classes mitigate double delete resources. For resources like TCP network connections that can be a…