网志档案列表:3 / 2006

《Corpse Bride》婚礼誓词 @ 3/31/2006

With this hand, I will lift your sorrows. Your cup will never be empty, for I, will be your wine. With this candle, I will lig...
发布于 3/31/2006 15:52:54 | 评论:0

More Effecitve C++ 6: Distinguish between postfix and prefix forms of increment and decrement @ 3/31/2006

What's the difference between obj++ and ++obj? [code] class A{ public: ... inline A & operator ++ (){ *this+=1...
发布于 3/31/2006 13:04:18 | 评论:0

More Effective C++ 5: Be wary of user-defined conversion funcitons @ 3/30/2006

Two types of implicit conversions: 1. Single-argument constructors 2. Type conversion operators e.g. [code] class Name{ ...
发布于 3/30/2006 17:41:39 | 评论:0

More Effective C++ 4: Avoid gratuitous default constructors @ 3/29/2006

Sometimes we can't initialize an object without any information. For example, an Emploree class may require an emploree ID, an n...
发布于 3/29/2006 13:28:53 | 评论:0

More Effective C++ 3: Never treat arrays polymorphically @ 3/28/2006

Polymorphism and pointer arithmetic simple don't mix. consider the following code: [code]class Base{...}; class Derived:publi...
发布于 3/28/2006 13:28:46 | 评论:0

More Effective C++ 2: Prefer C++-style casts @ 3/27/2006

There are four types of C++-style casts: dynamic_cast static_cast const_cast reinterpret_cast They are used like this: [...
发布于 3/27/2006 20:55:31 | 评论:0

More Effective C++ 1: Distinguish between pointers and references @ 3/24/2006

Main differences between pointers and references: 1. Pointers [i]should[/i] be initialized while references [i]must[/i]. 2. Po...
发布于 3/24/2006 13:54:03 | 评论:0

优化大矩阵运算速度 @ 3/15/2006

太大的矩阵(1000*1000以上)在使用一般的算法运算时会产生很多的cache miss,导致运算速度太低,所以有必要进行优化 1000*1000的整型矩阵需要占用大约4MB,这样大的数据一般是不可能完全放到cache里的,所以最好的方法就是把它切...
发布于 3/15/2006 14:07:13 | 评论:1

Effecitve C++ 50: Improve your understanding of C++ @ 3/15/2006

With this item comes the end of Effective C++ 2nd Edition, a book I have read for over 3 months. I have learnt a lot from this b...
发布于 3/15/2006 11:11:58 | 评论:0

Effective C++ 49: Familiarize yourself with the standard library @ 3/14/2006

1. The specification of C++ standard library takes over 300 closely-packed pages in the °C++ standard. 2. Most of the classes i...
发布于 3/14/2006 16:30:02 | 评论:0

Effective C++ 48: Pay attention to compiler warnings @ 3/14/2006

Unlike compilers of other languages, C++ compilers warns you only when it thinks there is something wrong. For example, here is ...
发布于 3/14/2006 9:06:21 | 评论:0

太监小说…… @ 3/13/2006

  本来我这个人是不喜欢看长篇小说的,上研究生之前唯一看过的长篇是三个火枪手,还是两天看完的。总之我不喜欢那种拖拖拉拉的感觉,总喜欢很快的知道结果。   天意弄人,上了研究生后,室友是一个爱看小说的家伙,基本上网上有点名声的小说他都看过了,结果有一天无聊...
发布于 3/13/2006 21:57:38 | 评论:0

Effective C++ 47: Ensure that non-local static objects are initialized before they are used @ 3/13/2006

Consider the following code: [code] // file theFileSystem.cpp FileSystem theFileSystem; ... // file Directory.cpp class ...
发布于 3/13/2006 15:53:45 | 评论:0

Effective C++ 46: Prefer compile-time and link-time errors to runtime errors @ 3/10/2006

The problem with runtime errors is that they are unpredictable. You may get no error while testing, but you are not sure whether...
发布于 3/10/2006 22:50:55 | 评论:0

Effective C++ 45: Know what C++ silently writes and calls @ 3/9/2006

C++ will automatically generate constructors, destructors, copy constructors address-of operator and assignment operator for you...
发布于 3/9/2006 10:47:32 | 评论:0

Effective C++ 44: Say what you mean; understand what you're saying @ 3/8/2006

This is a summary of Item 35-43. . A common base class means common traits. . Public inheritance means isa. . Private inherit...
发布于 3/8/2006 12:29:51 | 评论:0

Effective C++ 43: Use multiple inheritance judiciously @ 3/7/2006

I haven't used multiple inheritance before. The reason for that is it's too complex. So my suggestion is to use single inheritan...
发布于 3/7/2006 10:47:58 | 评论:0

Effective C++ 42: Use private inheritance judiciously @ 3/6/2006

[code] class B{ public: void mf(); .... } class D:private B{ ... } void doSomething(B b){ ... } ...
发布于 3/6/2006 13:23:09 | 评论:0

Effective C++ 41: Differentiate between templates and inheritance @ 3/5/2006

A template should be used to generate a collection of class when the types of the objects [i]does not[/i] affect the behavior of...
发布于 3/5/2006 10:53:30 | 评论:0

Effective C++ 40: Model "has-a" or "is-implemented-in-terms-of" through layering @ 3/4/2006

Layering is the process of building a class on top of another by having the layering class contain an object of the layered clas...
发布于 3/4/2006 14:09:38 | 评论:0

Effective C++ 39: Avoid casts down the inheritence hierarchy @ 3/3/2006

Casting down the inheritence hierarchy, also known as downcasting, means casting a pointer or reference of a base class to those...
发布于 3/3/2006 13:45:02 | 评论:0

Effective C++ 38: Never redefine an inherited default parameter value @ 3/2/2006

A default parameter can exist only as part of a function. So if you want to redefine an inherited default parameter value, you h...
发布于 3/2/2006 21:43:21 | 评论:0

Effective C++ 37: Never redefine an inherited nonvirtual function @ 3/1/2006

Let B be the base class, and D be publicly derived from B. If B has a nonvirtual function mf(), then D should not redefine it. ...
发布于 3/1/2006 16:15:02 | 评论:0