HDTenEightyP/NetNews huggingface dataset:
From: pete@borland.com (Pete Becker)
Subject: Re: Define WIN30/WIN31 ?
Originator: pete@genghis.borland.com
Organization: Borland International
Date: Mon, 14 Dec 1992 18:15:32 GMT

In article <1ge3raINN5k3@agate.berkeley.edu> jeff@emily10.Berkeley.EDU (Jeffrey C. Ely) writes:
>Why are there errors in Borland's
>own example source files and header files ?!?  I know I'm missing something. 
>Can anyone help?

	Sounds like pilot error.  Use the .PRJ file or the makefile, rather
than compiling directly from the command line.
	-- Pete
From: ventura!vs@UCSD.EDU (Shankar Venkataraman)
Newsgroups: comp.lang.c++
Subject: Inheriting Objective-C classes into C++ classes
Date: 12 Dec 92 22:16:00 GMT
Reply-To: ventura!vs@UCSD.EDU
Organization: Ventura Software, Inc., A XEROX Company


We are having a set of classes defined in Objective-C. We are now shifting to C++ and
would like to inherit the Objective-C classes into C++ classes. It is presumed that a C++ wrapper would be required for the Objective-C classes. If anyone has tried doing such a thing earlier, their experiences would be invaluable to us. ( The underlying idea to the whole exercise is to avoid rewriting a large Objective-C codebase into C++ ).

Thanks in advance

Shankar
ventura!vs@ucsd.edu
Newsgroups: comp.lang.c++
From: 76336.3114@CompuServe.COM (Kevin Dean)
Subject: Posting to comp.lang.C++ from CompuServe
Date: 16 Dec 92 20:58:45 GMT

It seems that people are more interested in being able to post from
CompuServe than in discussing my problem.  I'll repost my problem.

If you want to know how, drop me a PRIVATE note.  I will reply PRIVATELY.
Please do NOT post my reply as a news item without my permission as one
person has already done.  As for how long this avenue will remain open, I
don't know; if the volume from CompuServe becomes to horrendous for the
site in question, it may choose to deny access.  We'll see.

In the meantime, if any net gurus are listening and know of approved mail
drops for Usenet postings from outside systems like CompuServe, please
drop me a note and I'll pass it on to those who have asked me.  Thanks.

For those who do want to post from CompuServe, keep in mind that the
volume of mail coming in from comp.lang.c++ will bankrupt you in a month. 
For this reason, I have to maintain a separate account on a Usenet feed
that lets me read for free.  Bear it in mind.
From: pickerig@eee.bham.ac.uk (Guy Pickering)
Newsgroups: comp.lang.c++
Subject: Re: Is there a lint++?
Date: 18 Dec 92 10:30:38 GMT
Organization: The University of Birmingham, England
NNTP-Posting-Host: nanda_devi.eee.bham.ac.uk
X-Newsreader: TIN [version 1.1 PL6]

Allen M. Theobald (theobald@ucunix.san.uc.edu) wrote:
: 
: Fellow Netters!
: 
: This may seem peculiar, but is there such a thing as lint++ to 
: check C++ code?  Or does lint have a switch to do the same?
: 

lint is a tool to highlight problems in C code. It was designed to
suppliment pre-ANSI C compilers, because they would quite happily
pass bad code (mainly in the area of parameter mis-matches).

Your C++ compiler should not need lint. lint (as far as I know)
offers nothing your C++ compiler will provide. Anything that is not
caught at compile time will be caught at link time bacause of
type safe linkage.

Guy

--
+--------------------------------+-----------------------------------------+
| Guy Pickering                  | School of Electronic & Electrical Eng,  |
| E-MAIL: G.PICKERING@uk.ac.bham | University of Birmingham,               |
| Tel: (021) 414 4340            | Edgbaston, Birmingham. B15 2TT.         |
+--------------------------------+-----------------------------------------+
Newsgroups: comp.lang.c++
From: as@progress.COM (Amitabh  Shukla)
Subject: EC++ (extended c++?)
Summary: Where can I get the source/libraries for EC++.
Keywords: OOP, c++
Organization: Progress Software Corp.
Distribution: comp.lang.c++
Date: Wed, 16 Dec 1992 18:53:25 GMT

Aloha,

	I was reading an old JOOP (September,91. Vol. 4, No. 5) sometime back and found an 
interesting article on "EC++ (extended c++)" by "Glauco Masotti". Does anyone out there
know where he is and was there any more work done on this? Is it possible to get the source
from some ftp site?

EC++ provided the following four feature in C++ enviornment:
	a: Assertion checking
	b: parameterized classes
	c: exception handling
	d: garbage collection.

Any help will be greatly appreciated. Thanks in advance.

Amitabh Shukla.
email: as@progress.com
From: chou@riscee.pko.dec.com (Jesse Chou WSG/SECG)
Newsgroups: comp.lang.c++
Subject: need help compiling (linking) Borland C++ programs using templates.
Date: 17 Dec 92 23:12:12 GMT
Organization: Digital Equipment Corporation, Maynard MA

This may be a very basic and silly question to ask but I am new to Borland
c++.  It is greatly appreciated that someone could enlighten me or give me
pointer to a FAQ.


I am writing a list class using template and got link error:

Error: Undefined symbol slist_base::append(slink near*) in module tpc.cpp


I had a similar error using other c++ compiler and found that I have to use
a command line switch with the compiler.  I suppose that someone could
easily point to me what I should do in my makefile.  Or maybe there is
other problems that I am not aware of.  In any rate, thanks in advance.



Jesse



-- 
Jesse Chou	-- chou@riscee.enet.dec.com

These words are entered into net by the keyboard.
I am not responsible for them; neither is my employer.


-- 
Jesse Chou	-- chou@riscee.enet.dec.com

These words are entered into net by the keyboard.
I am not responsible for them; neither is my employer.
From: dom@oasis.icl.co.uk (dominic alston)
Newsgroups: comp.lang.c++
Subject: Re: Give me safe C++
Date: 14 Dec 92 11:51:11 GMT
X-Newsreader: Tin 1.1 PL3

jimad@microsoft.com (Jim Adcock) writes:
>In article <716@ulogic.UUCP> hartman@ulogic.UUCP (Richard M. Hartman) writes:
>|the cry comes "oh powers that be, protect us from ourselves", and thus
>|we get laws requiring people to wear seatbelts.  It is no that
>|I am against seatbelts (or safety), but I was perfectly capable
>|of wearing a seatbelt before the law existed. 
>
>To warp your analogy just a little bit, I am reminded of the rental car
>I was stuck with recently that "automatically" -- in the name of "safety" 
>presented a motorized shoulder harness across my neck every time I tried
>to climb in or out of the car.  Meanwhile, while I was automagically getting
>strangled, there was no equivalent mechanism to connect the seatbelt, 
>so if you did crash, you'd be strung up for good.
>
>No thanks!  Give me the *tools* necessary for safety -- the lapbelts, the
>shoulder harnesses, etc, and let *me* apply them myself.  Poorly applied
>safety devices are more dangerous than no safety devices at all!

This is starting to get good, maybe we should compile something for a book ?

--
Dominic Alston                                 "Where am I ?.. In the village."
International Computers Ltd.               
Lovelace Road.                              dom@oasis.icl.co.uk ||
Bracknell RG12 4SN                          ..!uunet!mcvax!ukc!iclbra!dom ||
Berks, England.                             da16@unix.brighton.ac.uk

Tel: +44 344 424842 x2324
Fax: +44 344 487832

Disclaimer: class MyDisclaimer : public StdDisclaimer {
                 public: MyDisclaimer():StdDisclaimer() { }
            }
Newsgroups: comp.lang.c++
From: sabroe@daimi.aau.dk (Morten Sabroe Mortensen)
Subject: Re: Operator "new" - how to catch array-allocation?
Organization: DAIMI: Computer Science Department, Aarhus University, Denmark
Date: Thu, 17 Dec 92 13:12:39 GMT

The reason I raised this in the first place is, I'm about to build my own
special-purpose-heap-manager, -the way I would like it to work, is to attach
"something" to a given class, and then the result should be, that all dynamic
allocation involving that class should be managed - the way you allocate
should be independent of how heap-management is controlled - controlled by
the normal general-purpose manager or a special-purpose manager!
As I see it, -now-, I can't get this independency - except when allocating 
single instances of the used class! Right?

        -- Morten.

---------------------------------------------------------------------------
 Morten Sabroe Mortensen,         e-mail: sabroe@daimi.aau.dk
 Department of Computer-science - University of Aarhus, Denmark.
---------------------------------------------------------------------------
Newsgroups: comp.lang.c++
From: pjl@cs.uiuc.edu (Paul Lucas)
Subject: Re: Static vars in member functions
Organization: University of Illinois at Urbana-Champaign
Date: Thu, 17 Dec 1992 20:46:04 GMT

In <1992Dec13.185540.20212@math.ufl.edu> x9999bvj@maple.circa.ufl.edu writes:


>When calling a function of a class with a static variable declared in it,
>what is the standardized behaviour for that variable?

*****>	The same as for a non-member-function.

>E.g.

>class Foo
>{
>   public:
>      void Blah( void );
>};

>void Foo::Blah( void )
>{
>static int i;

>   i++;
>};

-- 
	- Paul J. Lucas				University of Illinois	
	  AT&T Bell Laboratories		at Urbana-Champaign
	  Naperville, IL			pjl@cs.uiuc.edu
From: matt@physics.berkeley.edu (Matt Austern)
Newsgroups: comp.lang.c++
Subject: Re: Give me safe C++
Date: 18 Dec 92 10:07:13
Organization: Lawrence Berkeley Laboratory (Theoretical Physics Group)
	<1992Dec14.190553.14838@mole-end.matawan.nj.us>
	<1992Dec17.192301.23525@ucc.su.OZ.AU>
	<HF.92Dec18115942@whyaduck.tk.telematik.informatik.uni-karlsruhe.de>
Reply-To: matt@physics.berkeley.edu
NNTP-Posting-Host: physics.berkeley.edu
In-reply-to: hf@tk.telematik.informatik.uni-karlsruhe.de's message of 18 Dec 92 11:59:42

In article <HF.92Dec18115942@whyaduck.tk.telematik.informatik.uni-karlsruhe.de> hf@tk.telematik.informatik.uni-karlsruhe.de (Harald Fuchs) writes:

> I agree that they are sometimes quite handy, but I've never missed
> them. In the old days when I was a Modula-2 addict, I used them most
> of the time in a situation where I needed a function call in a
> specific context (which in turn can be expressed as a kind of
> "state"), and this is exactly what objects are for.

This is indeed exactly what objects are for; there is, however, one
small problem.

Suppose that you need to pass a function in a specific context to
another routine *as a function pointer*.  Objects, in this case,
aren't useful: you can't pass a pointer to an object (or, for that
matter, a pointer to a member function) when the routine you're using
expects a pointer to a function.

Possible solutions:
	(1) Rewrite the routine so that, instead of expecting a pointer 
	    to a function, it expects a Function, where Function is an
	    abstract function-like class.  (You can even provide 
	    conversion operators so that your routine will do the right
	    thing if the user just gives it a function pointer.)
	(2) Use a static function, and encode the state using static 
	    variables.  This is a clumsy solution (it puts state variables
	    in file scope instead of class scope, and it will do horrible
	    things if this function ever calls itself recursively), but,
	    for simple enough cases, it will work.

The first of these methods is clearly the right one, and I think that
it does provide most of the functionality of nested functions.  Still,
I have to admit that I think nested functions would be nice.  I miss
them most when I'm doing a two-dimensional integration; what I want to
do would be trivial in Scheme, but is somewhat clumsier in most of the
other languages (including C++) that I've used.
--
Matthew Austern                   Just keep yelling until you attract a
(510) 644-2618                    crowd, then a constituency, a movement, a
austern@lbl.bitnet                faction, an army!  If you don't have any
matt@physics.berkeley.edu         solutions, become a part of the problem!
Newsgroups: comp.lang.c++
From: jimad@microsoft.com (Jim Adcock)
Subject: Re: Overriding the order of constructors?
Date: 15 Dec 92 19:12:48 GMT
Organization: Microsoft Corporation
Keywords: constructor ordering

In article <Bz8oGx.B7x@well.sf.ca.us> johnrp@well.sf.ca.us (John Panzer) writes:
|In article <robison1.724307343@husc10> robison1@husc10.harvard.edu (Keith Robison) writes:
|>	I believe you can effectively accomplish this dangerous
|>goal by calling virtual functions in your constructors:
|>
|>
|>class A {
|>  A() { reroute(); do_A_ctor_stuff(); }
|>  virtual void reroute(); { }
|>}
|>
|>class B : public A {
|>  B() {}
|>  void reroute ()  { do_B_ctor_stuff(); }
|>}
|>
|>
|>This will cause B's reroute() to be executed before any 
|>A constructing has occurred.
|>
|
|Are you certain?  I believe that A::reroute() will
|be called if reroute() is called from within A's
|constructor or destructor.  I think this is a
|common C++ "gotcha" - it's certainly gotten me
|in the past.

Before  A::A() is executed on your object, your object is only
a bag o' bits.  It is only a bag o' bits.

When A::A() begins executing on your object, your object becomes
an A.  It may not be a fully formed A, because fully forming A
is your job inside A::A().

When B::B() begins executing on your object, your object becomes
an B.  It may not be a fully formed B, because fully forming B
is your job inside B::B().

....

When B::~B() begins executing on your object, your object becomes
an B.  It may not be a fully deformed B, because fully deforming B
is your job inside B::~B().

When A::~A() begins executing on your object, your object becomes
an A.  It may not be a fully deformed A, because fully deforming A
is your job inside A::~A().

After A::~A() executes on your object, your object is only a
bag o' bits.

======

In the case of constructors/destructors of objects with virtual functions,
compilers typically *actually* implement these "type changes" of your
object, as it is being formed or deformed by its various constructors
or destructors, *by dynamically changing your object vtable pointer[s]*.
If you haven't actually looked at the assembly code generated for some
simple constructors/destructors and inheritence, its well worth the
exercise!  There be dragons!

[Note that compilers have been known to screw this stuff up.]

Below find a little hack program that may ;-) demonstrate modification
of the vtable ptrs during construction / destruction on your system:

#include <stdio.h>

class A
{
public:
	virtual void print();
	virtual int size();
	A() { printf(" A() "); print(); }
	virtual ~A() { printf("~A() "); print(); }
};

void A::print()
{
	for (int i=0; i<size(); ++i)
		printf("%02X ", (unsigned)*(((unsigned char*)this)+i));
	printf("\n");
}

int A::size() { return sizeof(A); }

class B : public A
{
	long L;
public:
	virtual int size();
	B() : L(0x12345678) { printf(" B() "); print(); }
	virtual ~B() { L = 0x55555555; printf("~B() "); print(); }
};

int B::size() { return sizeof(B); }

main()
{
	B b;

	return 0;
}
Newsgroups: comp.lang.c++
From: sdm@cs.brown.edu (Scott Meyers)
Subject: Re: Virtual base classes
Keywords: virtual, class
Organization: Brown University Department of Computer Science
Date: Wed, 16 Dec 1992 04:02:28 GMT

In article <445@genie.UUCP> roger@genie.UUCP (Roger H. Scott) writes:
| In article <1992Dec8.192759.24081@cs.brown.edu> sdm@cs.brown.edu (Scott Meyers) writes:
| >In article <rmartin.723768537@thor> rmartin@thor.Rational.COM (Bob Martin) writes:
| >| ... There is nothing that can be done with private inheritance that cannot
| >| be done, just as simply, with containment.
| >
| >Except for redefining virtual functions and accessing protected members.
| 
| If Kludge is a non-public subclass [derived class] of WellFormed then there
| isn't much point in talking about Kludge redefining WellFormed's virtual
| functions since you can't use a Kludge in a place where a WellFormed is
| expected (i.e., who would ever have hold of a Kludge and send it one of
| WellFormed'd messages [call one of WellFormed'd virtual functions], other than
| a member function of Kludge?).

And if a member function of Kludge calls a nonvirtual function of
WellFormed that itself makes calls to virtual functions of WellFormed that
are redefined in Kludge...?

Scott


-------------------------------------------------------------------------------
What do you say to a convicted felon in Providence?  "Hello, Mr. Mayor."
From: friedman@hp-and.an.hp.com (joel friedman)
Date: Wed, 16 Dec 1992 14:13:34 GMT
Subject: The ARM
Organization: Hewlett-Packard Company
Newsgroups: comp.lang.c++
Keywords: ARM

Hello,

I've been monitoring this group for about a month, and have seen many references
to the ARM.  Is this a public document?  Is it available in print or electronically?  I'm learning C++ now, but could use a definitive reference.
The book I'm using now is called "The C++ Programming Language" by Dijikstra
(most likely spelled wrong).  Is the ARM better for my purposes?

Responses by private e-mail please, unless you think everyone would be interested.

Thanks,
Joel
-- 
__________________________________________________________________________
Joel Friedman           friedman@hp-and.an.hp.com           (508) 681-2709

 ///  /_ _  \\\   H E W L E T T          Imaging Systems Division
(((  / //_/  )))                         3000 Minuteman Road
 \\\   /    ///   P A C K A R D          Andover, Massachusetts 01810-1087
__________________________________________________________________________
Newsgroups: comp.lang.c++
From: mat@mole-end.matawan.nj.us
Subject: Re: Need help implementic data structures of generic objects
Summary: New Lamps for Old, New Hacks for Old
Organization: :
Date: Sun, 13 Dec 1992 14:14:00 GMT

In article <1992Dec11.233253.27540@informix.com>, cshaver@informix.com (Craig Shaver) writes:
> In article <1992Dec10.114636.16861@ucc.su.OZ.AU> maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
> >In article <42186@sdcc12.ucsd.edu> cs161feu@sdcc10.ucsd.edu (Anthony Minkoff) writes:
> >>Hi.  Another question from a C++ neophyte.
> ....
> >>The approach that has been
> >>suggested is:

> >>class Object {
> >>    /* ...etc... */
> >>};

> >	Dont do this Smalltalk hack please. A queue of Objects is
> >totally useless, since they are just Objects and not ever Widgets.
 
> YES! Do that elegant Smalltalk thing.  Do not listen to C++ hacks and
> bigots.  Put a little thought into it and do something (re)useful.

If you are programming in Smalltalk then by all means use the same
language construct for inheritance as for genericity.  But if you
are programming in C++, use the right tool: a template.

The template should describe the nature of a collection; the template
should be instantiated for the type of the thing being collected.
With the exception of collections of things to freeze and thaw and
a few like problems, there are no truly heterogenous lists in problems.
You are collecting objects because you are going to gurklemont them;
then you have a list of gurklemont'ables, NOT a list of wholly anonymous
Objects.

When in Smalltalk, Talk Small.  When in C++, think clearly and write
clearly.  True elegance means using a thing well as designed.

``We got elegance!  If you ain't got elegance, you can never, ever,
carry it off.''  --From ``Hello, Dolly''

``To use the language well, do not begin by hacking it to bits.''
					--Strunk and White
-- 
 (This man's opinions are his own.)
 From mole-end				Mark Terribile

 mat@mole-end.matawan.nj.us, Somewhere in Matawan, NJ
Newsgroups: comp.lang.c++
From: dernis@binah.cc.brandeis.edu
Subject: Templates
Reply-To: dernis@binah.cc.brandeis.edu
Organization: Brandeis University
Date: Sun, 13 Dec 1992 23:16:49 GMT

Hi,
  This is a fairly simple template question, I hope.
I have written a template class, which has been tested and
appears to work (mostly at least).  Now I tried to use and I 
have found a problem.

The class is a matrix class, and works with all numerical types
(I have only tested the two that I need - but presumably).

Now I want to declare a function which returns a complex Matrix.

So I wrote,

Matrix<complex> function();

But I discovered a problem immediately, that this interprets this
as instance of Matrix<complex>, not a function declaration.  It now
occurs to me that indeed that is exactly what I have written, and
it rightfully complains that I left out the arguments.

Does this mean at that I have to template this function too, and do 
something like:

template <class T>
void function(Matrix<T>& ref_to_value);

Is there a way I can write a function that will return a complex
instance of my matrix class without writing the function as a template.
The above my be acceptable, even better as it does not generate a 
temporary, but still. . .

Thanks,
Mitch Dernis
From: roger@genie.UUCP (Roger H. Scott)
Newsgroups: comp.lang.c++
Subject: Re: Checking the this pointer
Date: 14 Dec 92 00:32:05 GMT
Reply-To: roger@genie.UUCP (Roger H. Scott)
Organization: proCASE Corporation, Santa Clara, CA

In article <ByysvM.4yu@cs.uiuc.edu> pjl@cs.uiuc.edu (Paul Lucas) writes:
>In <92343.204152PPARSONS@ESOC.BITNET> <PPARSONS@ESOC.BITNET> writes:
>>Q: Meanwhile to people have ways round this. eg macros, function naming
>>conventions?
>
>*****>	Only if they see it as a problem; I, IMHO, don't any more than
>	the fact that you don't respecify virtual either.

I prefer to *only* use "virtual" in the base-most class so it is clear
when a new protocol [virtual function signature] is being added to a class.
When I redefine a virtual function I use a fake syntactic sugar keyword
"redefine" to document what's going on (wouldn't it be nice if you could just
define DerivedClass::someVirtualFunction() in derived_class.c and be done
with it, since redefining a virtual function does *not* change the class's
interface one iota?).  I also use syntactic sugar to hide the (admitedly
very intuitive :-}) "= 0" syntax for declaring pure virtuals.  E.g.,

#define redefine
#define subclass_responsibility =0

class Base {
public:
    virtual void someFunction() subclass_responsibility;
    // ...
};

class Mid : public Base {
public:
    redefine void someFunction();
    virtual void newInClassMid();
};

class Derived : public Mid { // protocol identical to Mid's
public:
    redefine void someFunction();
    redefine void newInClassMid();
};
Newsgroups: comp.lang.c++
From: joe@proto.com (Joe Huffman)
Subject: Re: Zortech C++ v3.1
Organization: FlashTek, Inc.
Distribution: usa
Date: Mon, 14 Dec 1992 23:23:33 GMT

jordan@aero.org (Larry M. Jordan) writes:

>[1] Is there a Windows hosted IDE included in the package?  
>    i.e. has zwb been ported to Windows?

I know the author of ZWB.  He told me he has a version of ZWB that works
under Windows, but Symantec decided not to ship it... I'm not sure why...
If there is enough interest FlashTek could provide it -- let me know.

>[2] Does the debugger debug ALL memory models?  Does the debugger debug 
>    the DOS extender code?

No.  But ou can get a version of the ZDB debugger under the name of 
FlashView from FlashTek that does support 32-bit DOS extender code.  
See the coupon that comes in the Zortech box for more details and prices...

>[3] Does the debugger support AT&T version 3.0? 

What sort of things does it have to do to provide this support?

>[4] Has the earlier debugger been completely supplanted by Multiscope?

You get a somewhat updated version of ZDB with the product, but no 32-bit
DOS extender support.

>[5] Is the product shipping as we speak?

Not according to my sources.  I got a beta copy early last week, this was
supposed close to the final, but that was a bit unclear to me.

>I'd appreciate a Semantic response.

I don't work for Symantec.  I work for FlashTek who supplied the DOS 
extender DOSX, debugger (ZDB) and FG to Symantec.

-- 
netcom!proto!joe
joe@proto.com