Message-ID: <3631E505.4773CBD3@montana.com> Date: Sat, 24 Oct 1998 08:32:37 -0600 From: bowman X-Mailer: Mozilla 4.5b2 [en] (Win95; I) X-Accept-Language: en MIME-Version: 1.0 To: djgpp AT delorie DOT com Subject: Re: construction has been delayed due to somebody's stupidity (most likely my own) References: <5zeY1.843$SI2 DOT 270 AT news DOT cwix DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com Mike Ruskai wrote: > > Well, the first thing I have to say is that your example does not demonstrate > the problem you indicate when I try to compile it, with no less than four > compilers (IBM VisualAge C++, Borland C++, GNU GCC, and DJGPP). yeah, but try the non-trivial snippet for interesting errors: <------------------------- badcode.cpp ----------------------> #include class MyClass { public: MyClass(); void say_hi(void); protected: int data; }; void MyClass::say_hi(void) { cout << "hello world\n"; } int main(void) { MyClass instance(); // point of interest instance.say_hi(); } <--------------------------- end: badcode.cpp -----------------------> or, for another variation on the theme, <--------------------------- stillbad.cpp -----------------------------> #include class MyClass { public: MyClass(); void say_hi(void); protected: int data; }; void MyClass::say_hi(void) { cout << "hello world\n"; } int main(void) { MyClass instance; // point of interest instance.say_hi(); } <------------------------------ end: stillbad.cpp --------------------------> this one actually compiles and executes under gcc. I don't know if the proir two will make it through any compiler, but I would be suspicious of a compiler that did accept them. <------------------------------ end: thisworks.cpp --------------------------> #include class MyClass { public: MyClass() {}; void say_hi(void); protected: int data; }; void MyClass::say_hi(void) { cout << "hello world\n"; } int main(void) { MyClass instance(); // point of interest instance.say_hi(); } <------------------------------ end: thisworks.cpp -------------------------->