[MECpp]Item-10 Prevent Resource Leaks in Constructors
· โ 7 min read
Replace pointer class members with their corresponding smart pointer objects to fortify the constructors against resource leaks in the presence of exceptions, to eliminate the need to manually deallocate resources in destructors, and to allow const
member pointers to be handled in the smae graceful fashion as non-const
pointers.