-
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…