码迷,mamicode.com
首页 >  
搜索关键字:5 c++ boost 智能指针    ( 2698个结果
【资料整理】scribe安装配置
【资料整理】scribe安装配置1.安装boost。 _______________________________________________________________________________________________________ yuminstallautomakegcc-c++libevent-developensslopenssl-develboostboost-develbzip2-develpython-devel 注: 1)客..
分类:其他好文   时间:2014-12-25 06:44:58    阅读次数:281
智能指针的实现--使用引用计数实现以及原理
一、智能指针   在C++语言编程时,当类中有指针成员时,一般有两种方式来管理指针成员:一是采用值型的方式管理,每个类对象都保留一份指针指向的对象的拷贝;另一种更优雅的方式是使用智能指针,从而实现指针指向的对象的共享。       智能指针(smart pointer)的一种通用实现技术是使用引用计数(reference count)。智能指针类将一个计数器与类指向的对象相关联,引用计数跟踪该...
分类:其他好文   时间:2014-12-24 22:45:20    阅读次数:161
Effective c++--智能指针 & 函数模板
Shared_ptr允许当智能指针被建立起来是指定一个资源释放函数绑定于智能指针身上,也就是说在shared_ptr被初始化的同时也可以指定其管理的资源的释放函数。Shared_ptr提供的某个构造函数接受两个实参:一个是被管理的指针,另一个是引用次数变为0时将被调用的“删除器”。Shared_ptr构造函数坚持其第一个参数必须是个指针。它支持定制型删除器。   缺省情况下C++以by val...
分类:编程语言   时间:2014-12-24 21:33:06    阅读次数:217
string 常用 方法
boost::array header;string(header.begin(),header.end())std::vector body(atoi((string(header.begin(),header.end())).c_str()));string headlength(std::to...
分类:其他好文   时间:2014-12-24 17:42:33    阅读次数:145
Effective C++ .15,16获取原始资源和成对使用同类型new和delete
15. 智能指针可以通过get操作#include #include #include using namespace std;class Orange {private: int weight;public: Orange(int w) : weight(w) {} int ge...
分类:编程语言   时间:2014-12-21 23:18:59    阅读次数:199
Effective C++ .14 智能指针的拷贝与deleter函数
#include #include #include using namespace std;class Kiwi {private: int weight;public: Kiwi(int w) : weight(w) {} ~Kiwi() { cout p(new...
分类:编程语言   时间:2014-12-21 22:07:54    阅读次数:396
Effective C++ .13使用智能指针来引用资源
#include #include #include using namespace std;class Kiwi {private: int weight;public: Kiwi(int w) : weight(w) {} ~Kiwi() { cout p(new...
分类:编程语言   时间:2014-12-21 21:55:21    阅读次数:213
C++智能指针的设计和使用
对于一个C++的使用者来说,指针的使用可以算的上是家常便饭,但是在使用的过程中,很多时候可能会因为new或者malloc了一个对象,而忘记最后结束的时候去释放掉(我就会犯这样子的错误),从而导致内存泄露。而此时智能指针可能可以帮助我去解决这个问题。 智能指针(smart pointer)是利用个引用计数的策略去处理指针的释放,从而保证指针的安全性。通常情况下,我们会自己去设计一个智能指针类去管理...
分类:编程语言   时间:2014-12-21 16:40:36    阅读次数:227
c++ boost库
boost是C++标准委员会库工作组发起的开源库,内容十分强大。支持正则表达式,多线程编程,数据结构图(STL扩展),智能指针,python语法等功能。linux下安装boosthttp://blog.csdn.net/i_noname/article/details/632344Linux上安装使...
分类:编程语言   时间:2014-12-21 12:43:24    阅读次数:198
VS2010编译Boost 1.57 静态链接库
0、前提Boost库版本 1.57.0下载地址http://www.boost.org/users/history/version_1_57_0.html,选择windows版编译器:VS2010编译目标:静态链接库C/C++运行库链接方式: /MT /MTd /MD /MDd官网给出的wind.....
分类:其他好文   时间:2014-12-20 16:51:51    阅读次数:499
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!