🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #1233

Re: Now is the time (Was: Improvements on C++?)

#1233
From: Hendrik Boom
Date: Mon, 14 Dec 1992 15:28
37 lines
1679 bytes
jbn@lulea.trab.se (Johan Bengtsson) writes:
: Johan Bengtsson (jbn@lulea.trab.se) wrote:
: Fergus James HENDERSON (fjh@munta.cs.mu.OZ.AU) wrote in comp.lang.c++:
: : 
: : The compiler should warn about any code that has a high likelyhood of being
: : a programming error, except where such code is actually necessary in some
: : cases and cannot easily be rewritten to avoid the warning.
: 
: I absolutely agree.  How about this one:
: 
: // myFile.cc
: class MyClass {
: //...
: };
: IMPLEMENT_TYPE(MyClass);
: 
: "IMPLEMENT_TYPE" is a macro defined in a header file, and guess what?
: I forgot to #include it.  Does the compiler warn about this?  No!
: It thinks it is a function prototype with return type "int"!
: How wonderful...

But C++ allows another place where you can leave out the int.
How about:

typedef int Foo;

class MyClass {
	MyClass(Foo())
};

Is this a constructor taking a Foo-valued function argument,
or a redeclaration of Foo in an inner scope as a method returning a MyClass?
-- 
-------------------------------------------------------
Try one or more of the following addresses to reply.
at work:	hendrik@vedge.com,  iros1!vedge!hendrik
at home:	uunet!ozrout!topoi!hendrik
Technical Details
Message-ID: <1992Dec14.152854.25395@vedge.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!sun-barr!olivea!charnel!sifon!thunder.mcrcim.mcgill.edu!sobeco!philmtl!vedge!hendrik
References: <5349@holden.lulea.trab.se>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!sun-barr!olivea!charnel!sifon!thunder.mcrcim.mcgill.edu!sobeco!philmtl!vedge!hendrik
From: hendrik@vedge.com (Hendrik Boom)
Newsgroups: comp.std.c++
Subject: Re: Now is the time (Was: Improvements on C++?)
Message-ID: <1992Dec14.152854.25395@vedge.com>
Date: 14 Dec 92 15:28:54 GMT
References: <5349@holden.lulea.trab.se>
Organization: Visual Edge Software Ltd.
Lines: 37