HDTenEightyP/NetNews huggingface dataset:
Organization: University of Illinois at Chicago
Date: Wednesday, 16 Dec 1992 15:29:37 CST
From: <U54294@uicvm.uic.edu>
Newsgroups: comp.lang.c++
Subject: Re: So What About the New IBM C++?
Distribution: comp

Hi,
   I haven't had the chance to try it out yet, but I've poked around
on the CDRom. It's a beta test version, only on the Professional Developers'
Kit CD as far as I know. It has quite extensive container class libraries
which are seemingly well documented. I'll post more as I find out more.
                              Nick Geovanis
                              U54294@uicvm.uic.edu   <-- Best
                              GEONI02@hera.cai.com
From: jamshid@ut-emx.uucp (Jamshid Afshar)
Newsgroups: comp.lang.c++
Subject: Re: Overriding the order of constructors?
Summary: too complicated; RTFAQ
Keywords: constructor ordering
Date: 17 Dec 92 18:32:34 GMT
Reply-To: jamshid@emx.utexas.edu
Organization: The University of Texas at Austin; Austin, Texas

In article <robison1.724307343@husc10> robison1@husc10.harvard.edu (Keith Robison) writes:
|dembo@csri.toronto.edu (Prof. Ron Dembo) writes:
|>What is the rational for not allowing a programmer to override the
|>default calling order of constructors and initializers?

If you're asking why you can't construct a derived class's data member
before constructing a base class, I think because that would just add
complexity and confusion.  At least one problem is how to handle the
order of destructor calls.  The class and data member destructors
should be called in the reverse order their constructors were called.
If different member initialization lists could specify different
construction orders, there would be no practical way to know which
order to destroy the members.

|	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.

No, it will not.  Any virtual functions called during a constructor
call that class's definition of the virtual functon, not a derived
class's.  See FAQ #65 "Why does base ctor get *base*'s virtual fn
instead of the derived version?".  The FAQL is available by anonymous
ftp at sun.soe.clarkson.edu in pub/C++/FAQ.

Jamshid Afshar
jamshid@emx.utexas.edu
Newsgroups: comp.lang.c++
From: sjm@bcrki65.bnr.ca (Stuart MacMartin)
Subject: Re: A modest proposal...
Organization: Bell-Northern Research Ltd., Ottawa, Canada
Date: Tue, 15 Dec 1992 15:33:41 GMT

In article <724382816snx@trmphrst.demon.co.uk> nikki@trmphrst.demon.co.uk writes:
>In article <1992Dec11.172729.20503@newshub.ariel.yorku.ca> cs911461@ariel.yorku.ca (C. Armour-Kidson) writes:
>> comp.lang.c++'ers,
>> 
>> Due to amount of traffic on this group concerning Borland C++ and
>> other DOS specific compilers, would it be rude to suggest that 
>> such material be moved to another newsgroup, say, comp.lang.c++.borland
>> or comp.lang.c++.dos or something?  I can't speak for everyone but
>> it's getting hard to find articles specific to C++.
>
>Yes, I find these just as irrelevant as the numerous questions about HP, 
>Sun, X, NIH and Interviews :-)
>
>I agree that this group has (in practice, even if not in theory) too wide 
>a remit. It would be a good idea to separate out queries about specific 
>compilers (whether Borland or GNU or cfront).
>
>Whether it would be a good idea to have a separate group for each 
>compiler, or each operating system, or each hardware platform, I don't 
>know. If there were groups "comp.lang.c++.unix", "comp.lang.c++.dos" and 
>"comp.lang.c++.other", is there any chance that users (particularly new 
>users) would use the correct group for OS/compiler specific questions ? 
>
>No, I thought not :-(

There is a lot of traffic in this group, but a lot of it is from new users.
How many of them hit the right group, don't ask FAQs, create new topics instead
of following up an arbitrary one, and have appropriate keywords in the subject
for kill files?

I would be happy if people would mention Borland in the subject if the
topic is primarily Borland, and if they would change the subject if the
subject has changed, and if there was some common kill word for "My program
doesn't work - can you find the bug?".  My kill file does not screen out
much noise.  I wouldn't want to read this group without a threaded newsreader,
though.  

Stuart

--
: Stuart MacMartin                                    email: sjm@bnr.ca      :
: Bell-Northern Research                              phone: (613) 763-5625  :
: PO Box 3511, Stn C, Ottawa, K1Y-4H7, CANADA    Standard disclaimers apply. :
From: bjoerns@PROBLEM_WITH_INEWS_GATEWAY_FILE (Bjoern Stabell)
Newsgroups: comp.lang.c++
Subject: Re: Survey: File Extension
Date: 12 Dec 92 19:10:11 GMT
Organization: University of Tromsoe, Norway
X-Newsreader: TIN [version 1.1 PL7]

Eric Smith (erc@netcom.com) wrote:
] In article <78146@hydra.gatech.EDU> andy@federation.gatech.edu (Andy Register) writes:
] >In article <1gb1h0INNle2@tsavo.hks.com> webb@hks.com writes:
] > >I have a survey question for you all:
] > >
] > >	What extension do you believe is correct for C++ source code?
] > >	Is a clear majority winner emerging?  The contenders are: .C, .c
] > >	and .cxx. 
] >
] >don't forget .cpp for all us borland users.
] 
] That's not just Borland.  A lot of other vendors, such as Microsoft and
] Zortech, use it too.  I think the reason why a lot of Unix compiler
] vendors didn't like .cpp and used .cc, .C, .cxx, etc. was that the name

Was .cpp the original C++ extension?

] C++ wasn't originally intended to be pronounced "see plus plus", as the
] ++ operator was originally called the increment operator, and a lot of
] C programmers considered people who called it "plus plus" to be
] uneducated.  But that has gradually changed over the years, and now the
] majority calls C++ "see plus plus" and uses .cpp as the filename
] extension.  So we might as well standardize on .cpp, because that's the
] way it's going anyway and no one can stop it.

Well, when I see cpp, I think about the C Pre Processor (/lib/cpp).
I.e., it's ambigous in the UNIX world.  Maybe that's why they avoided
it - given that UNIX C++ compilers were the LAST ones to emerge, which
I'm not so sure about.

Btw, if one uses .C, isn't .H the right extension for C++ header files?
I've not seen it used very often.


Kind regards,
--
                                             Bjxrn Stabell
                                             University of Tromsx
                                             (+47) 83 44 053 / 83 75 164
                                             bjoerns@staff.cs.uit.n
From: andy@federation.gatech.edu (Andy Register)
Newsgroups: comp.lang.c++
Subject: C++ conferences?
Date: 14 Dec 92 13:35:28 GMT
Organization: CERL-EE, Georgia Institue of Technology

Some time ago, there was a post about a c++ conference on
numerical techniques.  I think it is to be in Oregon and the
submission deadline is Dec 31.

I have lost the information for the conference.  Will someone
please e-mail the information.

Thanks.
Andy
From: bs@alice.att.com (Bjarne Stroustrup)
Newsgroups: comp.lang.c++
Subject: Re: Operator "new" - how to catch array-allocation?
Date: 20 Dec 92 18:54:15 GMT
Organization: AT&T Bell Laboratories, Murray Hill NJ



maxtal@extro.ucc.su.OZ.AU (John MAX Skaller @ MAXTAL) writes

 > 	It is not currently possible to overload operator new[],
 > if only because there is no such operator. There is a proposal
 > before the committee to allow this, and I dont believe there are any
 > in-principle objections to it. 

Better still (or worse, depending on your point of view), The proposal
has passed and it will soon be time to try out implementations from your
local C++ compiler purveyor.
From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
Newsgroups: comp.lang.c++
Subject: Re: Memory allocation failures and good design question
Date: 20 Dec 92 12:37:19 GMT
Organization: MAXTAL P/L C/- University Computing Centre, Sydney

In article <720@ulogic.UUCP> hartman@ulogic.UUCP (Richard M. Hartman) writes:
>In article <1992Dec03.135428.33868@rs6000.bham.ac.uk> pickerig@eee.bham.ac.uk (Guy Pickering) writes:
>>
>>My advice is add a member function isOk(), and ensure that this function
>>only returns TRUE if all memory allocation, (or other resource use,
>>eg opening files) was performed ok. Then you can do:
>>
>>  SomeObject* object = new SomeObject;
>>  if (object->isOk() == FALSE)
>>  {
>>    // handle error.
>>  }
>>
>
>Unfortunately there is more to it than that:
>
>You cannot call pObj->isOk() until you first check to see that
>you got any sort of object back from new.
>
	You can if you make isOK a static member.
	Setting 'new_handler' seems a good idea in many programs though.


-- 
;----------------------------------------------------------------------
        JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
	Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
Newsgroups: comp.lang.c++
From: cbt@hobbes.inesc.pt (Conceicao Batista Tavares)
Subject: static members of templates
Organization: INESC, Lisboa Portugal
Distribution: comp
Date: Tue, 15 Dec 1992 10:11:17 GMT


I want to have a static member of a template

Example:

        class A {
                int a;
        };

        template<T> class exemple {
          static int elem;
        };

For the definition of the static member I have to do this?

        int exemple<A>::elem;

The problem is that I have to assign a value to the parameter of the
template to define the static member, and by consequence I have no 
longer the facilities that I could achive with templates.

I don't know if my problem it's clear.

Thanks for any help.

--Sao
 
--
<> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> 
<> Programs don't |        Sao Tavares                         <>        
<> run, just walk |   E-mail: cbt@yosemite.inesc.pt            <>      
<> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <>
From: bhays@teal.csn.org (Boyd Hays)
Newsgroups: comp.lang.c++
Subject: C++ Coroutine Class?
Date: 14 Dec 92 02:38:31 GMT
Organization: Colorado SuperNet, Inc.

Hello,
  I'm trying to use the AT&T C++ task classes on a SUN using CC3.0.1.
  It is unclear to me how to have a task yield the processor without
  that task becoming IDLE. I'm running on a Sparc and SUN doesn't 
  distribute the source so I can't figure it out.

  1) Does anyone know how to have a task relinquish the processor?

  2) Is a more complete example than that provided with the documentation
     available anywhere?

  3) In Tony Hansen's book "The C++ Answer Book" it mentions that the
     solution to problem 7.10 (the new and improved tasking system) does
     not run on a Sparc. Is this true, or does anyone have a set of diffs
     that will allow it to work?

Thanks in advance,
Boyd Hays
bhays@csn.org
From: ren@miles.mps.ohio-state.edu (Liming Ren)
Newsgroups: comp.lang.c++
Subject: Questions about iostream. Please help!
Date: 18 Dec 1992 14:33:02 -0500
Organization: Department of Mathematics, The Ohio State University
Distribution: world
NNTP-Posting-Host: miles.mps.ohio-state.edu

The following program was posted in this group (not by me) a while ago. 

#include    <iostream.h>
#include    <strstream.h>
#include    <fstream.h>
int main( int argc, char ** argv )
{
    istream * is;
    if( argc == 2 ){
        is = new ifstream( argv[ 1 ] );
    }else{
        is = &cin;
    }
    while( *is ){
        ostrstream out_str;
        is->get( *out_str.rdbuf( ));
        is->ignore( 1, '\n' );
        cout <<out_str.rdbuf( )<< endl;
    }

    if( argc == 2 ){    // Delete the object created. 
        delete is;
    }
    return 0;
}


After I study it, I have two questions:

(1) If I use it as : a.out file1>file2, diff tells me there is an extra newline added to file2
at the end of file. I don't see how this can happen. How to correct it?

(1) About the main while loop. It is my understanding that *is is a class instance of
istream with the following picyure:

	______	         _____________________
	| is |---------->|                   |
	------           |                   |
	                 | istream           |
	                 |___________________|

How (*is) can be zero and how it is set to zero? Does this mean that the class instance is 
zero? I am comfused here.


Many thanks!
Newsgroups: comp.lang.c++
From: jimad@microsoft.com (Jim Adcock)
Subject: Re: The fate of my exponentiation operator proposal
Date: 16 Dec 92 18:59:14 GMT
Organization: Microsoft Corporation

In article <BzCFyM.2r5@frumious.uucp> pat@frumious.uucp (Patrick Smith) writes:
|It would be nice to be able to use these words in C++ programs
|without having to worry about future versions of the standard,
|even if only in some contexts (eg. as member function names).

Verses it would be nice to be able to port C code to C++ without having
to rewrite the whole da*ned thing.  My concern is that I am seeing people
*trying* to port C to C++ and having a hellish time of it.  I'd like to
think that most of the time C code would compile under C++ with no
changes.  This is not what I'm seeing though.  Further, the proposed
changes take away the ability to selectively decide whether a std library
should be implemented in one's code via a function call, or an inline
[albeit macro] expansion, without giving programmers an equivalent functionality

Newsgroups: comp.lang.c++
From: richieb@bony1.bony.com (Richard Bielak)
Subject: Re:  Give me safe C++
Organization: multi-cellular
Date: Fri, 18 Dec 92 13:49:37 GMT

In article <716@ulogic.UUCP> hartman@ulogic.UUCP (Richard M. Hartman) writes:

[...]

>Safety (when not being enforced by the language) is to a large
>extent (IMHO) a matter of good programming practices.  Like a
>seemingly ever-growing segment of the general populace, 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 my mind, there
>was no *need* for the law.  

This analogy with seat belts bugs me. Here is why. Seatbelts are there
for the benefit of consumer of cars.

This implies that programmers are *consumers* of programming
languages. This misses the point, that programmers are the
*manufacturers* of software.

Don't you agree, that safety regulations forced on the manufacturer
are a good thing? Rememeber the Ford Pinto?

Manufacturers often object to safety regulation, as it makes their
products harder to make. You could make a car that got 100 mpg, if you
made it out of styrofoam, but you wouldn't want to crash in it.

If you are writing safety critical software - let's say software that
controls the brakes in *my* car - I'd rather have you code in PASCAL
and run with all the runtime checks on. I don't want my brakes to stop
working just because you forgot an ampersand.

...richie


-- 
* Richie Bielak   (212)-815-3072   |                                          *
* Internet:       richieb@bony.com | Rule #1: Don't sweat the small stuff.    *
* Bang {uupsi,uunet}!bony1!richieb | Rule #2: It's all small stuff.           *
*    - Strictly my opinions -      |                                          *
From: ric@updike..sri.com (Richard Steinberger)
Newsgroups: comp.lang.c++
Subject: Re: C++ Coroutine Class?
Date: 14 Dec 92 17:21:27 GMT

Have you looked at chapter 7 in the SUN C++ Programmer's Guide: The
Co-routine Library?

ric steinberger


Newsgroups: comp.lang.c++
From: chaolin@fcit-m1.fcit.monash.edu.au (CHAOLIN CHANG)
Subject: Death of Borland C++ Compiler
Organization: Faculty of Computing and Information Technology, Monash University
Date: Thu, 17 Dec 1992 22:15:42 GMT


I was a loyal Borland C++ compiler user.  I love the IDE environment 
(though I only use it for creating the project file) and various tools 
bundled.  But as my programs are becoming complex (using pointer, pointer 
to pointer, pointer to pointer to pointer and farmalloc extensively), 
Borland compiler begins to fall over.  One of my colleagues is also 
suffering for the same experience when he tried to push the Borland compiler 
to its limits.

I had pulled all my hair out.  If the program is run within the debuger line 
by line, it works fine.  But as soon as I let go, it hung my PC.  

I recompile the same source code in Zortech.  It WORKS. 

I wonder if anyone else has the same experiences with me?

Charles
18/12/92




Newsgroups: comp.lang.c++
From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
Subject: Re: Death of Borland C++ Compiler
Organization: MAXTAL P/L C/- University Computing Centre, Sydney
Date: Fri, 18 Dec 1992 18:43:50 GMT

In article <chaolin.88@fcit-m1.fcit.monash.edu.au> chaolin@fcit-m1.fcit.monash.edu.au (CHAOLIN CHANG) writes:
>
>I was a loyal Borland C++ compiler user.  I love the IDE environment 
>(though I only use it for creating the project file) and various tools 
>bundled.  But as my programs are becoming complex (using pointer, pointer 
>to pointer, pointer to pointer to pointer and farmalloc extensively), 
>Borland compiler begins to fall over.  One of my colleagues is also 
>suffering for the same experience when he tried to push the Borland compiler 
>to its limits.
>
	PLEASE dont post this kind of thing without saying exactly
what version of the compiler you are using. Also, what compiler
switches? How big is your stack? How much data do you put on
the stack and in the data segment?

	I am using 3.1 and have no such problems. And I have
lots of a->b->c->d[i].f().g() type code :-( [I wont when
I finish packaging it properly] :-)

	Why are you using 'farmalloc'? Do you have any reason not
to use the large model exclusively? Apart from anything else, this
model generally allows portable code to be written while lower
models do not. In the large model, 'malloc' IS 'farmalloc'.

-- 
;----------------------------------------------------------------------
        JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
	Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
From: bruce@utafll.uta.edu (Bruce Samuelson)
Newsgroups: comp.lang.c++
Subject: Please keep citations short
Date: 17 Dec 92 01:59:09 GMT
Organization: University of Texas at Arlington

This is a busy newsgroup, and reading it from a 2400 baud modem on a
25 line terminal is arduous. Many of you are sloppy in citing previous
postings and include unnecessary material. I request that you keep
your citations to an absolute minimum. When I used to read news in a
60-70 line window on a workstation screen with an effective baud rate
of 60K, I didn't mind so much.

For those of you who are not constrained by 2400 baud, try to imagine
what it is like to enter a deeply embedded thread, with each
successive article citing earlier ones that you've just read, and
having to paint several screens of this repetition before getting to
anything new.
-- 
**********************************************************
* Bruce Samuelson	Department of Linguistics	 *
* bruce@ling.uta.edu	University of Texas at Arlington *
**********************************************************
Newsgroups: comp.lang.c++
From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
Newsgroups: comp.lang.c++
Subject: Re: do variable names in header and source need to match
Date: 20 Dec 92 12:29:50 GMT
Organization: MAXTAL P/L C/- University Computing Centre, Sydney

In article <717@ulogic.UUCP> hartman@ulogic.UUCP (Richard M. Hartman) writes:
>Haveing seen bunches of additional defaulted args added to constructors
>as projects march on, I would CERTAINLY like to see a name-specified
>extension.  If you ever get a preprocesser to do this, let me know!
>

	My understanding is that the committee seriously considered
named parameters and rejected them when the complications to the
type system and resultant ambiguities made them unworkable.

	Probably these same considerations would also apply to
a language extension implemented by a preprocessor.

-- 
;----------------------------------------------------------------------
        JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
	Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
Newsgroups: comp.lang.c++
From: schrod@iti.informatik.th-darmstadt.de (Joachim Schrod)
Subject: Re: Survey: File Extension
Date: Fri, 18 Dec 1992 10:53:54 GMT
Organization: TU Darmstadt

In article <1992Dec16.234517.15738@netcom.com>, erc@netcom.com (Eric Smith) writes:
> 
> What is the advantage of cc over cpp?  Just that it is 2 characters instead
> of three?  Is that a big advantage worth a flame war?  The fact is that the
> MS-DOS, etc., C++ compilers are being used by so many C++ programmers now
> that .cpp is becoming the standard by default.

Seems, that the ``all the world's a VAX'' time is over.

We have entered the ``all the world's a MS-DOS system'' era.

--
Joachim
Newsgroups: uw.dcs.general,comp.lang.c++
From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
Subject: Re: Operator Overloading problem
Organization: MAXTAL P/L C/- University Computing Centre, Sydney
Date: Sat, 19 Dec 1992 18:26:48 GMT

In article <1992Dec16.192756.13271@dcs.warwick.ac.uk> jas@dcs.warwick.ac.uk (Jason Morris) writes:
>
>  I have a class, Matrix, and I want to overload the operators +,-,* etc.
>Matrix has a private member Data, which is a pointer to some dynamically
>allocated storage. Matrix() allocates this storage, and ~Matrix() frees it.
>Fine so far.

	No. No good. You MUST also have a copy constructor and assignment
operator that copy the contents of Data, and delete and copy its contents,
respectively.

	At least initially, forget about the inefficieny, fix that later.
This technique is called the 'Orthodox Idiom' by Coplien, it 
ensures the objects are first class 'just like int'. Coplien
provides the full recipe, follow it slavishly.

>
>    friend Matrix operator+(Matrix& lhs,Matrix& rhs);

	friend Matrix operator+(const Matrix& lhs, const Matrix& rhs);
	//                      ^^^^^
	//   if you want to pass it expressions
>
>  And I just do "return <local Matrix>"
>

	And now it works. To make it more efficient, there are
lots of methods, Coplien is filled with them. Some matrix 
packages go so far as to just build a 'parse tree' of the
calculation rather than doing it straight away, to optimise
speed and memory use [defered binding]

	However, you should be able to make your package
more efficient without having to rewrite existing working
client code (although you might have to recompile).

-- 
;----------------------------------------------------------------------
        JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
	Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
Newsgroups: comp.lang.c++