文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
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);
}

相关阅读 更多 +
排行榜 更多 +
英雄大作战x官方正版下载

英雄大作战x官方正版下载

飞行射击 下载
坎巴拉太空计划正版下载

坎巴拉太空计划正版下载

模拟经营 下载
夜总会保安官方正版下载

夜总会保安官方正版下载

休闲益智 下载