Listing 5 Defining synthesized templates in C++

/* def_gen.cpp -- definitions generating file */

#define def_gen_cpp
#include "decl_gen.hpp"
#undef def_gen_cpp

#ifdef stack   /* open stack class envelope */

int stack::push(stack_ITEM * itemPtr)
{
   if (!full() && itemPtr) {
      itemPtrs[items++] = itemPtr:
      return 1;
   }
   return 0;
}

#endif   /* close stack class envelope */

/* parameter wrapup section */
#undef max_TYPE
#undef stack
#undef stack_ITEM
#undef stack_MAX_ITEMS

// End of File