May 20, 1998

Use reinterpret_cast<> operator for unsafe, non-portable casts

If your code contains unsafe type casts, such as casting an int to a pointer (which is not considered a standard conversion as opposed to casting an int to a float) or converting a pointer-to-function into void *, you should use the reinterpret_cast operator: void * = (void *) 0x00ff;

vector<> members must define < and == operators

The STL vector, as well as other standard containers, support comparison and sorting of their members by calling the corresponding standard functions found in the header file. These functions rely on the relational operators such as == and < in order to accomplish that. In case of primitive types such

Test templates thoroughly

To write a test routine for a template class or function,you have to choose one concrete type for every formal typeof the template and run all tests on this instantiationof the template. Consider this buggy template function: template double max (T t1, T t2) { return t1>t2 ? t1 :