hit counter

Timeline

My development logbook

Item 28: Partition the Global Namespace

Don’t think anyone will seriously argue against the usefulness of namespace.

It is also mentioned that we can use struct to simulate the namespace functionality. But it will not be able to support direct, infix call of operator functions.

Item 23: Don’t Try to Return a Reference When You Must Return an Object

Example:

operator* and operator+ should return a new object instead of a reference. The latter approach will introduce problem such as memory leak

Additional note:

Avoid overloading short-circuiting operators: x || y or x && y. The overloaded versions of these do not short-circuit — they evaluate both operands even if the left-hand operand “determines” the outcome, so that confuses users.

From

C++ FAQ