The Rule of Zero -- Glennan Carnie

A complementary guideline to help to simplify the application code, without risking resource management issues.

The Rule of Zero

In a previous article – "The Rule of the Big Four (and a half)" we looked at resource management policies in C++.

Resource management is the general term for using the mechanisms in C++ to ensure that resources – files, dynamic memory, sockets, mutexes, etc – have their lifetimes automatically controlled so as to prevent resource leaks, deadlocks, etc. C++ refers to these mechanisms as RAII/RDID ( “Resource Acquisition Is Initialisation / Resource Destruction is Deletion”)

In this article we’ll have a look at a complementary guideline to help simplify your application code, without risking resource management issues – The Rule of Zero.

If you’re not familiar with the concepts of resource management I’d highly recommend having a look at the whitepaper before reading on.

Add a Comment

Comments are closed.

Comments (1)

0 0

Abyx said on Jan 16, 2015 08:54 AM:

Btw, the original article about the Rule of Zero is here - http://isocpp.org/blog/2012/11/rule-of-zero