C++編程規(guī)范
利器在手,不要再徒手為之C++語言所強制施行的構(gòu)造函數(shù)/析構(gòu)函數(shù)對稱反映了資源獲取/釋放函數(shù)對,比如fopen/fclose, lock/unlock, new/delete, malloc/free的本質(zhì)的對稱性,這使得具有資源獲取的構(gòu)造函數(shù)和具有資源釋放的析構(gòu)函數(shù)的基于棧(或引用計數(shù))的對象成為了自動化資源管理和清除的極佳工具
posted on 2007-04-16 00:33 Legend 閱讀(131) 評論(0) 編輯 收藏 引用
Powered by: C++博客 Copyright © Legend