{logo}

April 2001
Volume 19 Number 4

TESTING AND DEBUGGING

C++ Conformance Roundup

Compiled and edited by Herb Sutter
There is no C++ compiler or library today that implements the Standard perfectly, but some are getting close. Here, finally, is a first attempt to quantify just how close.

A Handy Debugging Class

Maurice Fox
Tracing, debugging, and timing — all in one package and dynamically controllable with simple, intuitive control strings.

Adding Exception Testing to Unit Tests

Ben Stanley
Exceptions can add a bewildering number of potential execution paths to otherwise simple code. Here is a way to test those extra paths without writing a bazillion test cases.

C/C++ CONTRIBUTING EDITORS

The New C: Declarations and Initializations

Randy Meyers
C99 provides many new options for when and how a variable begins its life. The benefit is code that is less buggy and more readable.

Uncaught Exceptions: eWriter

Bobby Schmidt
Just when we’re fixin’ to swear at VC++ again, it turns around and does something right.

C++ Made Easier: How Vectors Grow

Andrew Koenig & Barbara E. Moo
The Standard C++ library delivers reasonable performance by default. If you’ve ever wondered how, or what is implied in the word “reasonable,” read on.

STL & Generic Programming: STL Container Iterators

Thomas Becker
We’ve all heard we can use iterators “just like pointers,” but that isn’t the whole story. Some iterators are important for what they won’t let you do — especially when protecting the integrity of a container.

Common Knowledge: A Question of Respect

Steve Dewhurst
There are a few small items in C++ that should be marked “not for casual use.” Casting is one of them; Steve makes it clear as to why.

DEPARTMENTS

Editor’s Forum

New Products

We Have Mail

C++ EXPERTS ON THE WEB

In this new, web-only component of CUJ, we continue publication of the columns that were popular in the former C++ Report magazine. The following articles are featured on the CUJ website this month:

"Generic<Programming>: Min and Max Redivivus"

by Andrei Alexandrescu
It is surprisingly difficult to create template-based min and max functions that are as versatile as their macro-based counterparts. Andrei manages to do it with some effort, and this leads him to speculate on what’s wrong with programming languages today.

"The Standard Librarian: Stringstreams and Their Friends”

by Matt Austern
Like other streams, stringstreams are thin wrappers around buffers, and it is in the buffers where we find the most opportunities for extending the Standard C++ library.

"Conversations: Manipulations"

by Jim Hyslop and Herb Sutter
If you need to do some simple text processing on stream I/O, consider getting a little intrusive. Write your own manipulators to produce an intuitive and efficient interface.

"Effective C++ Standard Library: Unary Predicates in the STL"

by Klaus Kreft and Angelika Langer
When you start using STL algorithms in earnest, you’ll need to write unary predicates. Usually these just amount to simple little functions, but with some important restrictions attached.

"Object Interconnections: Using Standard C++ in the OMG C++ Mapping"

by Douglas C. Schmidt and Steve Vinoski
We can’t expect CORBA to use all the goodies C++ has to offer, but it never hurts to dream. The authors finish their tour of hypothetical C++ mappings with a look at life on the server side.