Rogue Wave Banner

Click on the banner to return to the user guide home page.

©Copyright 1996 Rogue Wave Software

Declaring Generic Collection Classes

All the Tools.h++ generic collection classes are declared as in the example above, using the declare macro defined in the header file <generic.h>. However, there is one important difference in how the Tools.h++ classes are declared versus the pattern set by Stroustrup (1986, Section 7.3.5). The difference is summarized below:

typedef int* intP;
declare(RWGStack, intP)                               //Wrong!
declare(RWGStack, int)                                //Correct.

In Stroustrup, the class is declared using a typedef for a pointer to the collected item. The Rogue Wave generic classes are all declared using the item name itself. This is true for both the reference-semantics and value-semantics classes.


Previous file Table of Contents Next file