码迷,mamicode.com
首页 >  
搜索关键字:high item check    ( 24079个结果
Effective C++ Item 39 明智而审慎地使用 private 继承
经验:private 继承意味 is-implemented-in-terms of。它通常比 composition 的级别低。 但是当 derived class 需要访问 protected base class 的成员,或需要重新定义继承而来的 virtual 函数时,这么设计是合理的 经验:和 composition 不同, private 继承可以造成 empty base 最优化。这对致力于“对象尺寸最小化”的程序库开发者而言,可能很重要 示例1:虽是 Empty class,但却不仅要花...
分类:编程语言   时间:2014-07-15 22:41:05    阅读次数:284
Effective C++ Item 47 请使用 traits classes 表现类型信息
经验:Traits classes 使得"类型相关信息"在编译期可用。它们以 templates 和 "templates 特化"完成实现 示例: template class deque{ public: class iterator{ public: typedef random_access_iterator_tag iterator_category; }; }; //template template struct iterator_trai...
分类:编程语言   时间:2014-07-15 22:40:20    阅读次数:372
Effective C++ Item 35 考虑 virtual 函数以外的实现
1.virtual 函数版本 class GameCharacter{ public: virtual int healthValue() const; //返回人物的健康指数, derived classes 可重新定义它 }; 2.使用 non-virtual interface 手法,那是 Template Method 设计模式的一种特殊形式。 让客户通过 public non-virtual 成员函数间接调用 private virtual 函数 class GameCharacter{ pu...
分类:编程语言   时间:2014-07-15 22:36:18    阅读次数:364
Effective C++ Item 45 运用成员函数模板接收所有兼容类型
经验:请使用 member function templates(成员函数模板)生成"可接受所有兼容类型"的函数 示例:泛化 copy 构造函数 temmplate class SmartPtr{ public: template SmartPtr(const SmartPtr &other) //member template, 为了生成 copy 构造函数 : heldPtr(other.get()){...} T *get() const...
分类:编程语言   时间:2014-07-15 13:10:24    阅读次数:319
Effective C++ Item 44 将与参数无关的代码抽离 templates
经验:Templates 生成多个 classes 和多个函数,所以任何 template 代码都不该与某个造成膨胀的 template 参数产生相依关系 因非类型模板参数(non-type template parameters) 而造成的代码膨胀,往往可消除,做法是以函数参数或 class 成员变量替换 template 参数 示例: template //size_t 是非类型模板参数 class SquareMatrix{ public: //...
分类:编程语言   时间:2014-07-15 13:04:39    阅读次数:307
iOS性能优化
这篇文章来自iOS Tutorial Team 成员Marcelo Fabri, 他是Movile的一个iOS开发者. Check out hispersonal websiteorfollow him on Twitter.原文地址 当我们开发iOS应用时,好的性能对我们的App来说是很重要的.....
分类:移动开发   时间:2014-07-15 09:46:23    阅读次数:382
How to check if NSString begins with a certain character
How to check if NSString begins with a certain characterHow do you check if an NSString begins with a certain character (the character *).The * is an ...
分类:其他好文   时间:2014-07-14 20:51:24    阅读次数:177
USB2.0速度识别
我们知道USB2.0向下兼容USB1.x,即高速2.0的hub能支持所有的速度类型的设备,而USB1.x的hub不能支持高速设备(High Speed Device)。因此,如果高速设备挂到USB1.x的hub上,那该设备只能工作在全速模式下。不管是hub还是设备(device),对于速度的区分是非...
分类:其他好文   时间:2014-07-14 20:01:39    阅读次数:353
事务的acid
1.atomicity 原子性 数据库中的执行要么都完成,要么失败。2.consistency 一致性 通过一些约束(主键,外键,唯一性,check等)来保证数据跟业务一致。3.isolation 隔离性 事务执行不相互干扰,一个事务不能看到另一个事务运行时的某一刻的数据。 隔离性的等级分为:rea...
分类:其他好文   时间:2014-07-14 19:03:05    阅读次数:223
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!