联盟首页 协同开发 共创软件 开放源码 软件工程 共创论坛 关于联盟
  您的位置 » 开放源码库【成熟 - 项目摘要 首页 | 分类源码 | 提交源码 | 下载统计 | 原创源码 | 成熟源码 | 代码片断
 
 Smart Pointer that supports subclassing - 项目摘要
摘要 | 管理 | 论坛
文档 | 软件包

源码库中源码数量为19221
有贡献人员名单:

-= 更多 =-
  • ffdshow
  • jasperreports
  • PoolMan
  • Air Traffic Controller
  • virtualdub-win
  • CppUnit
  • Apache-SSL-Jserv
  • FCK editor
  • Async Professional
  • GLgraph
  • -= 更多 =-

    项目描述:
    Until now all smart pointer implementations that I have seen didn't support assignment between base and derived class pointers. Here is an implementation that does support it. I give you two implementations of smart pointers:
    1) Ptr - This smart pointer assumes that 'T' support reference counting by deriving from IRefCount (which is also supplied).

    2) SmartPtr - This smart pointer is more generic than Ptr while not assuming anything about the type 'T'. Being more generic costs having a small reference object created for each referenced object or type.

    直到目前我所见到过的所有的智能指针不支持基类和派生类指针间的赋值。这里是支持这一功能的实现。我给出了智能指针的两个实现:
    1) Ptr -这个智能指针假设通过派生自IRefCount 来支持引用计数。
    2) SmartPtr - 这个智能指针比Ptr 更通用,没有对 'T'进行任何假设。为了支持更多的通用性,只能让每个引用对象或类型创建更少的引用对象。
    来源: http://www.codeguru.com/cpp_mfc/smartPtrEfrati.shtml
    类别:
    发布者: cbd002

    最新发布源码包
    软件包 版本号 日期 本地下载
    smartPtrEfrati  1.0  2004-04-09 下载

    原始下载连接(国外) http://www.codeguru.com/code/legacy/cpp_mfc/smartPtrEfrati_demo.zip

      » 合 作 伙 伴