June 2018
Intermediate to advanced
348 pages
8h 45m
English
The Loan pattern, as the name suggest, loans a resource to a function In the example given below, a file handle is loaned to consumers of the class. It performs following steps:
The following code implements the Resource Loan pattern for resource management. The pattern helps to avoid resource leakage when writing code:
//----------- ResourceLoan.cpp #include <rxcpp/rx.hpp> using namespace std; ////////////////////////// // implementation ...