المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Smart Cleanup: Achieve More Reliable Resource Management with Our Custom C++ Classes



C++ Programming
03-29-2009, 02:42 AM
Managing resources in C++ is not easy. When you're unsuccessful, your app can leak all kinds of resources including file system handles, database connections, and, of course, memory. Even in garbage-collected ********s like Managed C++, resource management is difficult because garbage collection only deals with memory management, not the other resources that cause performance problems.In this article, the author describes the SmartAny template library he created, which uses a policy-based approach to dynamic resource management. Readers will learn how to use the SmartAny classes and policies to ensure the proper cleanup of their resources, be they files, OS handles, or native and unmanaged objects.

Eric Niebler

<a href="http://msdn.microsoft.com/magazine/1640f41c-4dee-423a-941a-b2c3e0214573">MSDN Magazine June 2003