среда, 22 октября 2014 г.

Ссылка. Why doesn't C++ provide a "finally" construct?


"Because C++ supports an alternative that is almost always better: The "resource acquisition is initialization" technique (TC++PL3 section 14.4). The basic idea is to represent a resource by a local object, so that the local object's destructor will release the resource. That way, the programmer cannot forget to release the resource."

Комментариев нет:

Отправить комментарий