January 14, 1999

Weaving Threads

Java provides two ways to create and run a thread. You can implement the Runnable interface or extend the Thread class. The Runnable interface defines a single method run(). Consider

Zero as a Universal Initializer

The literal 0 is an int. However, it can be used as a universal initializer for every data type, since it is automatically cast to the appropriate type. In this

The Copy Algorithm

The Standard Library provides a generic copy function, which can be used to copy a sequence of objects to a specified target. The first and the second arguments of copy()

Prefer Function Objects to Function Pointers

Passing a function pointer is a common practice in event-driven systems, whereby a callback routine is invoked through a pointer. C++, however, offers a better alternative to function pointers: function