C++ tip 11: Store newed objects in smart pointers in standalone statements

C++ tip 11: Store newed objects in smart pointers in standalone statements

Did you know that unlike other languages, C++ can decide the evaluation order of function parameters? Not being aware of this feature may produce memory leaks.

C++ tip 10: Know when to use delete and when to use delete[]

C++ tip 10: Know when to use delete and when to use delete[]

Do you know when to use delete and when to use delete[]. Knowing the difference will help avoid any memory leaks in your application.

C++ tip 9: Use objects to manage resources

C++ tip 9: Use objects to manage resources

As a developer, you need to properly manage resources to avoid any memory leaks. Managing resources manually is not a good idea. Scott Meyers provides several tips to help you manage resources more efficiently.

C++ tip 8: Avoid using exceptions in destructors

C++ tip 8: Avoid using exceptions in destructors

C++ does not like destructors that emit exceptions. Therefore, make sure that in your design, your destructors never emit exceptions and if possible make sure that another non-destructive method takes care of handling any exceptions throw.

C++ tip 7: Be sure to copy all of an object's data members and its base class parts

C++ tip 7: Be sure to copy all of an object's data members and its base class parts

In C++ make sure to always copy all of your data members in the copy constructor and copy assignment. If you have derived classes, make sure to invoke your base class copy constructor.