Boost之Smart_ptr库
来源:互联网 发布:剑雨江湖天罡进阶数据 编辑:程序博客网 时间:2024/05/16 12:55
//智能指针应用于桥接模式的例子
// smart_ptr.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include <vld.h>#include <Windows.h>#include "Sample.h"int _tmain(int argc, _TCHAR* argv[]){CSample sample;sample.Print();system("pause");return 0;}
//sample.h
#pragma once#include "boost//smart_ptr.hpp"#include "boost//make_shared.hpp"using namespace boost;class CSample{public:CSample(void);~CSample(void);void Print();private:class CBridge;//私有智能指针(CBridge类型)shared_ptr<CBridge> m_bridge;};
//sample.cpp
#include "StdAfx.h"#include "Sample.h"#include <iostream>using namespace std;class CSample::CBridge{public:CBridge(){}void BridgePrint(){cout<< "BridgePrint"<< endl;}};//CSample::CSample():m_bridge(new CBridge)CSample::CSample(){m_bridge = boost::make_shared<CBridge>();}CSample::~CSample(void){}void CSample::Print(){m_bridge->BridgePrint();}
0 0
- Boost之Smart_ptr库
- 初探boost之smart_ptr库学习笔记
- boost.smart_ptr库简介
- boost::smart_ptr之智能指针
- 【02】 Boost库学习笔记之智能指针(Smart_ptr)
- Boost Smart_ptr
- Boost::smart_ptr
- boost::smart_ptr
- Boost.smart_ptr.scoped_ptr--1
- Boost.smart_ptr.shared_ptr--2
- <Boost> smart_ptr智能指针
- Boost.Smart_ptr/enable_share_from_this笔记
- boost smart_ptr -> scoped_ptr
- boost smart_ptr 3-> scoped_array
- Boost.smart_ptr智能指针
- Boost 内存管理(smart_ptr库,pool库)
- [BOOST]学习使用点滴-3-Smart_ptr库[by galphy]
- Boost笔记(一) —— Smart_ptr库
- UITabBarController使用
- 建立 ssh 共享 git server
- ACM JAVA大数
- Unity3D研究院之Assetbundle的实战(六十三)
- Tree_Graph 判断T2是否为T1的子树 @CareerCup
- Boost之Smart_ptr库
- 自定义Persmission
- 视频会议压缩算法
- 我被爱情下了药
- mini2440驱动分析之TouchScreen
- Ubuntu12.04与蓝牙模块HC-06连接
- c#—MemoryStream读图片存入ImageList
- Eclipse for Android xml 文件代码自动提示功能
- IOS之应用程序设置