Boxing data

The first smart pointer we are going to look at is the Box. This very special type is the analogue to C++'s unique_ptr, a pointer to data stored on the heap that deletes said data automatically when it's out of scope. Because of the shift from stack to heap, Box can allow you some flexibility by intentionally losing type information.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.37.20