码迷,mamicode.com
首页 >  
搜索关键字:5 c++ boost 智能指针    ( 2698个结果
boost::interprocess::shared_memory_object(1)(基本类型)
#include #include struct pos2d{ int x; int y;};using namespace std;int main(){ //boost::interprocess::shared_memory_object类是按照单个字节的方式读写共享内存,用...
分类:其他好文   时间:2014-06-07 03:57:20    阅读次数:277
C++ Primer 学习笔记_90_用于大型程序的工具 --异常处理[续3]
用于大型程序的工具--异常处理[续3]九、auto_ptr类[接上]5、auto_ptr对象的复制和赋值是破坏性操作 auto_ptr和内置指针对待复制和赋值有非常关键的区别。当复制auto_ptr对象或者将它的值赋给其他auto_ptr对象的时候,将基础对象的所有权从原来的auto_ptr对象转给副本,原来的auto_ptr对象重置为未绑定状态。 auto_ptr strPtr1(new ...
分类:编程语言   时间:2014-06-05 08:34:36    阅读次数:366
编译GraphLab出错
/src/graphlab-master/deps/local/include/boost/atomic/atomic.hpp:166:16: error: ‘uintptr_t’ was not declared in this scope typedef atomic atomic_uintpt...
分类:其他好文   时间:2014-05-31 11:53:03    阅读次数:345
boost::interprocess::managed_shared_memory(2)(std::string)
#include #include #include #include using namespace std;int main(){ //boost::interprocess::shared_memory_object类是按照单个字节的方式读写共享内存,用起来不方便 boost::i...
分类:其他好文   时间:2014-05-30 12:56:14    阅读次数:225
boost::interprocess::managed_shared_memory(2)(std::deque)
struct shareDataEx : shareData{ int index; int total_size;};typedef managed_shared_memory::segment_manager segment_manager_t; //段管理器type...
分类:其他好文   时间:2014-05-30 11:23:53    阅读次数:267
C++ 智能指针详解
一、简介由于 C++ 语言没有自动内存回收机制,程序员每次 new 出来的内存都要手动 delete。程序员忘记 delete,流程太复杂,最终导致没有 delete,异常导致程序过早退出,没有执行 delete 的情况并不罕见。用智能指针便可以有效缓解这类问题,本文主要讲解参见的智能指针的用法。包...
分类:编程语言   时间:2014-05-28 16:51:32    阅读次数:354
关于boost 的smart_ptr 的使用问题
boost 的smart_ptr 库中含有好几种智能指针,大家用的最多的应该是shared_ptr ,为啥呢?好用,不用管他啥时候会自动删除等等,而且拷贝和复制都很到位, 但实际上,这个库也有问题,连城写过一片文章,详细介绍了boost::shared_ptr库的四宗罪,不过我觉得有的问题,实际上不...
分类:其他好文   时间:2014-05-28 03:30:26    阅读次数:343
【C++深入浅出】智能指针之auto_ptr学习
起:C++98标准加入auto_ptr,即智能指针,C++11加入shared_ptr和weak_ptr两种智能指针,先从auto_ptr的定义学习一下auto_ptr的用法。template class auto_ptr { // wrap an object pointer to ensure....
分类:编程语言   时间:2014-05-27 16:13:40    阅读次数:440
boost在lambda表达式中调用占位符参数的成员函数的方法
boost中lambda表达式中调用占位符参数的函数的方法...
分类:其他好文   时间:2014-05-25 21:56:52    阅读次数:239
the leak of the memory in c++ 03
The Leak of the Memory in C++     In this chaper I will introduce a new smart pointer which is scoped_ptr; It likes auto_ptr but better. When peopel use auto_ptr, sometimes they forget that auto_...
分类:编程语言   时间:2014-05-25 07:03:10    阅读次数:373
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!