- 博客(22)
- 资源 (1)
- 收藏
- 关注
转载 c++ 内存管理 1
new/[], delete/[] 解析,placement new定点分配 new handler per-class allocator static allocator std::alloc std::alloc_pool new/[], delete/[] 解析Complex* c = new Complex(1,2); 1. 分配内存 2. 指针转型 3. 调用对象构造函数try{
2017-06-05 10:33:06 377
转载 c++ 11 6
lambda使用注意事项 基于任务而不是线程 如果move廉价就传值,并且永远复制 尽可能使用emplace 补充bind实现,C++thread, 异步编程,logic_error()异常,硬件线程(核数目),软件线程(排队,系统层),std::tread 语言层。,joinable可连接, join,Detach, conditioanl variable 和mutex的使用 ,promise
2017-06-05 09:22:00 364
转载 c++ 11 5
RAII和auto_ptr 使用unique_ptr 管理排他性资源 使用shared_ptr weak_ptr 使用make_shared<>,make_unique<> pimpl使用技巧 补充shared_ptr 控制块实现引用计数, enable_shared_from_this<Item>实现 RAII和auto_ptrRAII Resource Acquisition Is Initia
2017-05-31 16:35:36 424
转载 C++ 11 4
常量迭代器 编译期与运行期 异常 RVO与move 完美转发实现与缺陷 补充 advance实现,函数带引用修饰 void work() & {}; void work &&{};swap实现,static_assert()实现, vector< bool > 和bitset区别,triviall
2017-05-27 11:31:08 547
转载 C++ 11/14 3
Rvalue and Lvalue std::forward moveable string mutable constexpr
2017-05-24 10:10:32 362
转载 C++ 11/14 2
关键字 =delete,=default,using, noexcept, override, final, decltype, lambda 函数 variadic template parameter 补充 1.make语法,2.swap, 3.exception,4.set 实现,5.remove_if meta programming. 6.虚继承,7.多继承,8.memcpy(),mems
2017-05-21 09:52:09 442
转载 C++ 补充
unnamed namespace https://zsounder.github.io/2017/05/16/cpp-unnamed-namespace/
2017-05-19 08:46:08 401
转载 C++ 11/14 1
variadic template parameter initializer list Explicit Ctor 补充 1.对象序列化(boost) 2. base64 编码 variadic template parameter
2017-04-26 10:55:27 316
转载 C++ 学习 13 设计模式 3
状态模式 备忘录模式 组合模式 迭代器模式 职责链 命令模式 访问器模式 解析器模式 分类:状态变化模式在组件构建过程中,某些对象的状态经常面临变化,如何对这些变化进行有效的管理?同时又维持高层模块的稳定?状态变化 模式为这一问题提供了一种解决方案. 典型模式 Sate, MementoState 状态模式动机: 在软件构建过程中,某些对象的状态如果改变,其行为也会随之而发生变化,比如文档处于只读
2017-04-18 11:51:43 289
转载 C++ 学习 12 设计模式 2
工厂方法 抽象工厂 原型模式 构建器 单例模式 享元模式 门面模式 代理模式 适配器 中介者 对象创建模式通过对象创建模式绕开new,来避免对象创建(new),从而支持对象创建的稳定。它是接口抽象之后的第一步工作。 典型模式 Factory Method Abstract Factory Prototype Builder工厂模式动机:在软件系统中经常面临着创建对象的工作;由于需求的变化,
2017-04-13 11:34:32 490
转载 C++学习 11 设计模式 1
面向对象设计原则 模板方法 策略模式 观察者模式 装饰模式 桥模式面向对象设计原则c++学习的两种思维 1.底层思维 向下 把握机器底层微观构造: 语言构造,编译转换,内存模型,运行时机制。抽象思维:向上 将抽象世界为代码 面向对象,组建封装,设计模式,架构模式。 深入理解面向对象 向下:深入理解散打面向对象机制 继承: 复用现有代码 封装: 隐藏内部实现 多态:改写对象行为 向上:
2017-04-06 15:30:01 572
转载 C++ 学习 10 STL 补充
万用hash function Tuple type traits move 万用hash function使用unordered container时(unordered set/multiset map/multimap) 如果是自定义类型需要指定hash function。 有两种指定方式 1. functor 2. function//1. #inclcude <funcytion
2017-03-28 16:02:06 415
转载 C++学习 9 深入STL 3
typename, typeid, iterator category type traits , iterator traits -Iterator adapter, container adapter, Functor adaptor,typename, typeid, iterator categorytypename 用法 1 在template< calss T, typename U
2017-03-23 12:59:58 472
转载 C++学习 8 深入 STL 2
深入Deque, queue, stack RB_tree set/multiset hashtable 补充unordered 容器 深入Deque, queue, stackDeque 双端队列有iterator, 可以insert deque的模板声明: template < class T, class Allocator = allocator< T> > class deque;
2017-03-16 17:49:22 328
转载 C++ 学习7 深入STL 1
OOP VS GP 分配器 容器之间实现关系与分类 深入List 迭代器设计原则与iterator traits作用 深入Vector,Deuqe,ArrayOOP VS GPOOP 将Data 和method 结合在一起。 OOP 设计原则开闭原则 (open-close Principle, OCP) 一个软件应该对扩展开放,对修改关闭,即在原基础上可扩展不可修改。保证程序执行的一致性。这也是
2017-03-09 12:27:58 557
转载 C++ 学习 6 STL容器使用
array vector queue list set/map unsorted set/maparraystd::array template < class T, size_t N > class array; 头文件 #include < array > 严格线性排序,连续存储,允许随机存取,可以通过指针加偏移地址访问,使用默认构造和析构函数静态分配空间,其大小是constant没有内存
2017-03-02 13:00:04 690
转载 C++学习5 对象模型
VPTR,VTBL 虚指针,虚表 关于this 动态绑定 const new delete 补充不能重载的操作符 类型转换 ## VPTR, VTBL 虚指针,虚表 ## GCC 4.9.2 64-bit class A { public: virtual vfunc1(){} virtual vfunc2(){} func1() {} func2() {} pr
2017-02-22 12:19:47 341
转载 C++ 学习4 泛型编程 面向对象
Conversion function non-explicit one argument ctor Pointer liker classes 智能指针,迭代器 Function like classes Functor 仿函数 namespace class template function template specialization, Partial spectialization te
2017-02-20 15:08:08 784
转载 C++ 学习3
继承 (Inheritance) 复合 (Composition) 委托 (Delegation) 继承表示 is-astruct _List_node_base { _List_node_base* _M_next; _List_node_base* _M_prev; }; template<typename _Tp> struct _List_node: public _List
2017-02-15 14:11:18 338
转载 C++ 学习2 Class with Pointer member
Boolan C++ 学习2 Class with Pointer member记录知识点: BigThree 空指针 const static sizeof explicit关键字 new delete 内存分布 C++ 数组指针 类/函数模板 Pointer/Function like object C++ 11 待补充知识点 BigThree拷贝构造, 复制构造, 析构函数 注意深浅拷贝:
2017-02-07 10:49:53 473
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人