Xref: utzoo comp.lang.c++:7453 gnu.g++:832 Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucsd!helios.ee.lbl.gov!pasteur!agate!WEB.berkeley.edu!c60c-2ca From: c60c-2ca@WEB.berkeley.edu Newsgroups: comp.lang.c++,gnu.g++ Subject: What is class Set? Message-ID: <1990May4.063948.15596@agate.berkeley.edu> Date: 4 May 90 06:39:48 GMT Sender: usenet@agate.berkeley.edu (USENET Administrator;;;;ZU44) Reply-To: c60c-2ca@WEB.berkeley.edu () Distribution: usa Organization: University of California, Berkeley Lines: 82 X-Local-Date: 3 May 90 23:39:48 PDT While looking at some of the files inside the g++-include directory, I discovered the following "strange" code: In "Set.hP" ... #ifndef _Set_h #pragma once #define _Set_h 1 #include #include ".defs.h" class Set { private: int count; public: int length(); .... // Some prototype declarations deleted... virtual & operator() (Pix i) = 0; virtual Pix seek( item); .... // Rest of body }; There exists a file called "defs.hP" and in it are the followings: In "defs.hP" ... #ifndef _defs_h #pragma once #define _defs_h 1 // equality operator #ifndef EQ #define EQ(a, b) ((a) == (b)) #endif // Similiar macros for LE, CMP, HASH ... And for "Pix.h", it contains the following: In "Pix.h" ... #ifndef _Pix_h #pragma once #define _Pix_h 1 typedef void * Pix; #endif As a matter of fact, the extraneous construct " ..." can be found in all the ".hP" and ".ccP" files under that directory. My first impression is that " ..." has something to do with 'parametrized type capability'. I also thought that the g++ compiler will perform the necessary pre-processing to substitue the actual type for T. However, when I tried to compile a simple program which includes files "Set.hP" and "Set.ccP", it became evident that "Set.hP" and "Set.ccP" have to under some pre-processing by a different pre-processor before they are fed to the g++ compiler. My questions then are: 1) What is the true meaning of " ..."? Does it really have something to do with parametrized type? 2) Where can I find the pre-processor necessary to convert the ".hP" and ".ccP" files to legal C++ programs? Any suggestion or help is GREATLY appreciated. Andrew Choi Internet Address: c60c-2ca@web.berkeley.edu Standard Disclaimer