文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>share_ptr 智能指针用法示例

share_ptr 智能指针用法示例

时间:2009-08-11  来源:asio

#include <boost/shared_ptr.hpp>
#include <iostream>
using namespace std ;
class connection
{
public :
    connection()
    {
    }
    virtual ~connection()
    {
        cout << " connection is over \n";
    }
    void done()
    {
        cout <<  "do is running \n";
    }
};

#include <stdlib.h>
#include <boost/smart_ptr/shared_ptr.hpp>

int main(int argc, char** argv) {

    boost::shared_ptr < connection > p ( new connection());

    p->done();
    p.reset(new connection());
   
    cout << "main is over \n";
    //

    return (EXIT_SUCCESS);
}

相关阅读 更多 +
排行榜 更多 +
茶叶蛋大冒险免费版

茶叶蛋大冒险免费版

休闲益智 下载
全民帮帮她

全民帮帮她

休闲益智 下载
屋顶旅行

屋顶旅行

休闲益智 下载