Letters

Dr. Dobb's Journal December 2003

C++ export

Dear DDJ,

In his August 2003 column, Al Stevens attempted to explain the export feature of C++ templates. To clarify:

Stephen Clamage

stephen.clamage@sun.com

C++ Compiler Correction

Dear DDJ,

In my article "Comparing C++ Compilers" (DDJ, October 2003), a transcription error in Table 4 suggested Visual C++ 7.1 does not support some uses of typename, nor the uses of member template functions and member template constructors. Visual C++ supports them all; see Table 1. Thanks to Herb Sutter for the heads up.

I also used the wrong flags for the Watcom compiler in the Dhrystone test, in which it actually can be demonstrated to do a great deal better than I showed on that test. Thanks to Michal Necasek of the Open Watcom team for pointing this out.

Finally, I'd like to clarify the rationale with respect to testing speed of generated code: Standard advice has it that optimization for speed is meaningful for test/demonstration purposes, but that real applications should optimize for size since the better cache performance outweighs any specific localized advantages in the larger speed-optimized code. On this premise, I used the corresponding test-for-size executables in the test-for-speed comparisons. Being a library kind of chap, I'm interested in portability, so I elected to target P5, rather than anything more "modern."

Errata for this can be found at http://synesis.com.au/articles.html#errata.

Matthew Wilson

matthew@synesis.com.au

DDJ