HDTenEightyP/NetNews huggingface dataset:
From: suresh@papaya.iss.nus.sg (Suresh Thennarangam - Research Scholar)
Subject: Re: How to prevent local instances, but allow "new"
Reply-To: suresh@iss.nus.sg (Suresh Thennarangam - Research Scholar)
Organization: Institute Of Systems Science, NUS
Date: Wed, 6 Jan 1993 02:01:19 GMT

In article <1icij0INNdhc@news.cerf.net> hlf@nic.cerf.net (Howard Ferguson) writes:
>I wish to define a class in a library which the library user
>can create by dynamic allocation via the new operator, but
>I want to prevent him from creating automic instances.
>
>I thought that giving the class a public new operator,
>but a private constructor would work, but this prevents
>any instances of either type from being created.

This was covered in this newsgroup a week or so ago.
Make the destructor private... that will do the trick. Declarations
of automatic instances will cause a compilation error when the
scope of the declaration ends.


      __                  
     (_   / /  o_   o  o |_
     __)/(_( __) (_(_ /_)| )_
***************************************************************************
* Suresh Thennarangam               *  EMail: suresh@iss.nus.sg(Internet) *
* Research Scholar                  *         ISSST@NUSVM.BITNET          *
* Institute Of Systems Science      *  Tel:  (065) 772 2588.              *
* National University Of Singapore  *  Facs.: (065) 778 2571              *
* Heng Mui Keng Terrace             *  Telex: ISSNUS RS 39988             *
* Singapore 0511.                   *                                     *
***************************************************************************
From: dijk@cwi.nl (Valentijn van Dijk)
Newsgroups: comp.lang.c++
Subject: how easy is installation of COOL library on SGI?
Summary: how easy is installation of COOL library on SGI?
Keywords: COOL, installation, SGI, library
Date: 6 Jan 93 14:02:59 GMT

Hello world,

I need a class library for a small project ( <1000  lines of code). I
will need the following:
	-small matrices,
	-vectors
	-n-trees

And only very basic operations on them.

I've looked through the c++ product list and the COOL library seems a
good choice. Does anyone have experience using, and installing, this
library. I've heard rumours installation is very hard. Is this true?

Thanks.

Valentijn van Dijk (dijk@cwi.nl)

Newsgroups: comp.lang.c++
From: chrisg@cs.umr.edu (Chris Gorsuch)
Subject: Protogen/ Owl directories
Date: Wed, 6 Jan 1993 06:00:43 GMT
Organization: University of Missouri - Rolla

I have recently purchased the Borland C++ 3.1 compiler.
It came with the ProtoGen windows creator included with it.
The problem is that Protogen is Looking for /borlandc/owl/owl.h
and it causes an error when it realizes that I have no owl directory
Any clue where this can be gotten and why it wasn't sent in the first
place.

Question 2 is what header file should I give protogen...
ie how do I hook MY code into the individual menus I have set up.
It would appear from the little pamphlet that I do all of the protogen
work first and THEN create my code and hook it into it.
but without being able to get by the owl problem I can't begin to tackle
the second problem
thanks
Please respond by email unless you feel others might be interested
chrisg@cs.umr.edu
.


Newsgroups: comp.lang.c++
From: gs4t@virginia.edu (Gnanasekaran Swaminathan)
Subject: Re: Intel 960 & moving C++ code to new platforms
Organization: University of Virginia
Date: Sun, 10 Jan 1993 22:25:20 GMT

buck@siswat.hou.tx.us (Lester Buck) writes:
: A friend needs to port some C++ code to an Intel 960 platform.
: He claims that there do not exist any C++ ports yet.  If anyone
: knows of a C++ port for the 960, could they please let me know.

intel sends out a new letter called insight 960 which decribes
all the products and applications based on 960. In that, they
repeatedly mention about GNU C and C++ compilers for i960.
You can contact them and ask for more details.

-Sekar
From: eric.hochman@factory.com (Eric Hochman) 
Newsgroups: comp.lang.c++
Subject: BORLAND C++ ; NEW INT(1,
Date: 4 Jan 93 09:54:00 GMT
Distribution: world
Organization: Invention Factory's BBS - New York City, NY - 212-274-8298v.32bis
Reply-To: eric.hochman@factory.com (Eric Hochman) 

Yes, you can allocate memory beyond 640K in Borland C++, but you'll need
to either purchase a DOS extender, or do a fair bit of assembler
programming.

"C Memory Management Techniques" by Dorfman & Neuberger, from Windcrest
Books, will explain the necessary techniques, as well as giving you
a pre-written package of routines you can use.
From: talamar@cs.concordia.ca (ANTONELLI michael a.)
Newsgroups: comp.lang.c++
Subject: Any maintenance releases for Borland C++ 3.1?
Date: 10 Jan 93 21:22:40 GMT
Organization: Computer Science, Concordia University, Montreal, Quebec

A friend of mine wanted to know if there have been any maintenance releases
of Borland C++ 3.1 since it was released and if so, what bugs do they
correct.

Thank-you in advance.  Please reply by e-mail.

-- 
******************************************************************************
Michael Anthony Antonelli            Internet: talamar@cs.concordia.ca

Concordia University, Montreal (Canada)
Newsgroups: comp.lang.c++
From: dave@mizar.csis.dit.csiro.au (David Campbell)
Subject: Sun C++ 2.1 PIC problem
Organization: CSIRO Division of Information Technology
Date: Mon, 11 Jan 1993 02:40:18 GMT

/* Here is a program which bombs with a bus error under Sun C++ 2.1 when
 * compiled with the position independant code (PIC) option.
 *
 * I can't get the problem to occur when compiler under C; Sun C++ has its
 * own ccom which must be messed up.
 *
 * Although this program is quite useless as it stands, it is valid C++ and
 * should run.
 *
 * Compile with: CC -PIC -o x x.c
 */

 /* x.c */

main()
{
        "a"; /* make sure that hello world is misaligned */
        "hello world";
}

-- 
  +--------------------------------------------------+-----------------------+
  | Dave Campbell                                    |            UNIX & C++ |
  | Phone: + 61 6 275 0944      Fax: + 61 6 257 1052 |   _--_|\       PLEASE |
  | CSIRO Division of Information Technology         |  /      \             |
  | Centre for Spatial Information Systems           |  \_.--._/ <- Canberra |
  | PO BOX 664                                       |        v              |
  | CANBERRA ACT 2601       +------------------------+                       |
  | AUSTRALIA               | dave@csis.dit.csiro.au |                       |
  +-------------------------+------------------------+-----------------------+
  |                       Get right.....or get left.                         |
  +--------------------------------------------------------------------------+
Newsgroups: comp.lang.c++
From: erc@netcom.com (Eric Smith)
Subject: Re: Is it possible to use 'delete this' ?
Organization: Netcom - Online Communication Services (408 241-9760 guest)
Date: Sun, 10 Jan 1993 22:27:05 GMT

In article <rmartin.726675168@thor> rmartin@thor.Rational.COM (Bob Martin) writes:
>"delete this" can only be appropriate for objects that are "always"
>allocated from the heap.  Unfortunately, there is no way for an object
>to insure this. 

Use a protected destructor.  There should be no compiler warning about
"delete this" because it is a normal and useful feature.
Newsgroups: comp.lang.c++
From: ralph@yo_dud.bell.ca (Ralph Doncaster)
Subject: semi-private public methods?
Reply-To: ralph@dci.pinetree.org
Organization: /home/yo_dud/ralph/.organization
Distribution: na
Date: Mon, 11 Jan 1993 19:30:11 GMT

I would like to have a class that has some public methods that can
only be used by a certain group of classes.
Lets call this class A, and I want B,C,D &E to be able to use the
public methods on A. (no problem so far)
However, I don't want classes X, Y, &Z to be able to use the methods,
nor any other similar classes added in the future.
I don't want B,C,D &E to access the private data of A, so I can't make
them friend classes.  A,B,C,D, &E aren't in the same heirarchy, so I
can't use inheritance to have a solution to the problem.
What I would like to be able to do is say that the public methods of A
are only public to a certain group of classes, and private to all
others.
Any ideas?

post, or reply to ralph@dci.pinetree.org

Newsgroups: comp.lang.c++
From: pjl@cs.uiuc.edu (Paul Lucas)
Subject: Re: c++.newbie has problem with mult. #includes
Organization: University of Illinois at Urbana-Champaign
Date: Tue, 12 Jan 1993 18:42:25 GMT

In <93Jan12.172129.20662@acs.ucalgary.ca> jabraham@acs.ucalgary.ca (John Abraham) writes:

>I have two classes, meplannode and emme2node.  Each of them is
>derived from the base class node.

>I want to use both of them in a file scope, so I #include "meplan.h" and
>"emme2.h".  Problem - both of them #include "node.h", so I get
>multiple definition errors for the node class.  What do I do?

>It seems pretty kludgy to put:
>#ifndef _classname
>...
>...
>...
>#define _classname
>#endif
>around every single .h file.

>Is this a common problem?  Am I missing something obvious?

	No; that's the way everybody does it.
-- 
	- Paul J. Lucas
	  AT&T Bell Laboratories
	  Naperville, IL
From: fad@zoo.bt.co.uk (Francisco A de Carvalho)
Newsgroups: comp.lang.c++
Subject: Re: Motif GUI Builders and C++
Date: 8 Jan 93 15:53:14 GMT
Reply-To: fad@zoo.bt.co.uk
Organization: BT Laboratories

>Objectworks calls its products Objectbuilder/C++ and Objectkit/OI.
>
Is anyone out there able to give me a contact point for Objectworks ?

I need to find out more about what functionality the products provide (eg Drag
 and Drop, which Class library it provides etc...)

To add to the discussion, CenterLine also has a product called 'ViewCenter'
which provides run-time selection of Motif/OpenLook, the OI Class Library,
Drag and Drop etc...

Thanks,

Francisco
---------------------------------------------------------------
F A de Carvalho			Configuration Management
				BT Labs
Telephone (0473) 642368		B67 / Room G11
Fax       (0473) 637614		Martlesham Heath
e-mail: fad@zoo.bt.co.uk	Ipswich IP5 7RE
---------------------------------------------------------------
Newsgroups: comp.lang.c++
From: winney@dal.mobil.com (Randy Winney)
Subject: Why X::X(X &a), not X::X(X a) ?
Organization: Mobil Exploration & Producing Technical Center(MEPTEC), Dallas. 
Date: Tue, 12 Jan 1993 15:51:59 GMT

Could someone explain to us neophytes why C++ requires
that I use the constructor
 X::X(X &a)
instead of simply
 X::X(X a)
Xref: sparky comp.lang.c++:19004 comp.object:4763
From: jimc@tekcae.cax.tek.com (Jim Carden)
Newsgroups: comp.lang.c++,comp.object
Subject: Re: Pros and cons of C++
Date: 12 Jan 93 15:02:50 GMT
Followup-To: comp.lang.c++
Organization: Tektronix, Inc., Beaverton,  OR.

>  John> Why then is it becoming so popular?  Why the deluge of texts,
>  John> articles, magazines, news groups, compilers, etc?  It seems to
>
>Because it is not complex, especially not if you already know C.
>...
>If you look at the
>minimal number of additions to C (most essential only a little
>extension of the struct syntax) I think it is amazing.
>The implications can be complex, but that is more due to OO than to
>C++ in particular. But it pays for most applications.

If the complications were only due to OO then C++ would be much less 
complex than it is.  For example, look at the complexity of 
Objective C compared to that of C++.
For another example, look at Andrew Koenig's article in the October 1992
issue of C++ Report. ("Classes that yield truth values"). The complexity
of this "feature" of C++ has nothing to do with object oriented programming,
per se. It has to do with C'ifying object oriented programming rather than
attempting to add OO to C as simply as possible.
--
Posted for Patrick Logan, patl@goldfish.mitron.tek.com
Organization: Middle East Technical University - Computer Center
Date: Wednesday, 6 Jan 1993 17:17:16 TUR
From: <C51881@TRMETU.BITNET>
Newsgroups: comp.lang.c++
Subject:    c++ parser

I need a c++ parser. Does anyone knows one?

                              budak arpinar
                                <C51881@TRMETU.BITNET>
From: cs163wav@sdcc8.ucsd.edu (Anthony Minkoff)
Newsgroups: comp.lang.c++
Subject: HELP: How to typedef for private members?
Date: 11 Jan 93 23:25:22 GMT
Organization: University of California, San Diego


I need to define a class with private members that are types created
for this class.  Since they are only needed for the class, the user
should not know about them.  E.g.:

class Foo {

    public:

        Foo ( );
        ~Foo ( );
        /* etc */

    private:

        typedef struct {
            int one;
            int two;
        } two_ints;

        two_ints a;

} ;

The problem with the above code is that when I #include this header
in a program, the program knows about the two_ints type.  Is there
any way to hide this type definition?

An example of this situation might be a LinkedList class.  The
LinkedList class might use a node struct or class, but users of the
LinkedList class would not need to know about or use nodes directly.

Reponses in e-mail, please.

Tony
Newsgroups: comp.lang.c++
From: wcwu@Uz.nthu.edu.tw (Wen-Chung Wu (CS U801572) TEL.)
Subject: Where is iostream.h ???
Organization: National Tsing Hua University (HsinChu)
Date: Tue, 12 Jan 1993 08:27:22 GMT


Newsgroups: comp.lang.c++
From: jimad@microsoft.com (Jim Adcock)
Subject: Re: Standard library functions and macros
Date: 06 Jan 93 18:38:19 GMT
Organization: Microsoft Corporation

In article <1993Jan5.052854.365@ucc.su.OZ.AU> maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
|In article <1993Jan04.224604.7304@microsoft.com> jimad@microsoft.com (Jim Adcock) writes:
|>Whether I'm overreacting or not also depends on whether people consider
|>it important to get programmers to switch from C to C++.  
|
|	IMHO much less of a problem than getting FORTRAN programmers
|to switch to C++. C programmers will switch to C whether they
|want to or not:  C-only compilers are likely to just fade away :-)

C-only compiler will fade away.  C-only code won't.  C-only programmers won't.
And as a result C++ compilers will have to remain C/C++ compilers into the
indefinate future.  This leaves many programmers in the worst of all worlds,
having to try to program both in C and in C++.  Much better is to avoid
"gratuitous" changes, such that porting code from C to C++ remains a
managable task.  Once the code compiles clean in C++, THEN you can start
working on turning that C programmer into a C++ programmer.  If they
can't even get their old code to compile in C++ mode, then they duck and
cover and try all the excuses in the world to avoid this new, C++, "broken"
compiler.
From: eric.hochman@factory.com (Eric Hochman) 
Newsgroups: comp.lang.c++
Subject: RE: BORLANDS NEXT C++ RE
Date: 4 Jan 93 10:09:00 GMT
Distribution: world
Organization: Invention Factory's BBS - New York City, NY - 212-274-8298v.32bis
Reply-To: eric.hochman@factory.com (Eric Hochman) 

-> If memory has not failed me, they included the Phar Lapp dos extender
-> with the 3.1 release of BC++. Quite some time ago.
Yes, they did...but it's a "Lite" version - it only lets you access
memory up to 2M (the full version of the 286 extender can access 16).
Not much documentation, and you can't distribute .EXEs you create using
the free version.  All in all, it's a sales pitch for the 'real' (i.e.
$495) version.
                                                                                         
Newsgroups: comp.lang.c++
From: pjl@cs.uiuc.edu (Paul Lucas)
Subject: Re: Variable length array in C++
Organization: University of Illinois at Urbana-Champaign
Distribution: usa
Date: Wed, 6 Jan 1993 18:51:44 GMT

In <SHIBUYA.92Dec28120216@chute.bl.applicon.slb.com> shibuya@bl.applicon.slb.com (Hiroto Shibuya) writes:

>Question from C minded programmer.

>What is a simple way in C++ to implement variable length array - an
>array which grow in size as needed?  In C, I often use realloc to
>reallocate an array to bigger size, but in C++, there is no
>corresponding "renew" (?).  Do I have to revert to malloc and realloc?
>My understanding was that I never have to use malloc in C++.

*****>	No; new a new array; copy old to new; delete old.


>Description of class "Blocks" in USL standard components sounds like
*****>	You're right.
-- 
	- Paul J. Lucas				University of Illinois	
	  AT&T Bell Laboratories		at Urbana-Champaign
	  Naperville, IL			pjl@cs.uiuc.edu
Newsgroups: comp.lang.c++
From: oper7@ee05.ncu.edu.tw (Anthony Shih Hao Lee)
Subject: Reusability will come true bringing by OOP?
Organization: Dep. of EECS, National Central University, Chungli, Taiwan, R.O.C.
Date: Tue, 12 Jan 1993 04:21:40 GMT

Hi, OOP experters:

These days, My friend and I argued that if reusability will come true
if we use OOP. Take a example, for those GUI class, if you do not have
good ability to write good (well-organized, clear) documents, then it
is impossible for a client to use your classes. Because he cannot
promise that all behaviors derived from superclass will work correctly.
so I heard someone write an article (on a magazine) critized C++ is not
a good OOPL due to it is not well self-explained.

Think about this if you are a TVISION programmers:
if Borland does not release TVision source code, do you really trust
the quality of that package?

any ideas are welcomed...
tony
-- 
>>> Anthony Li <Li3, Shih4 Hao2><Li:fruit's Name><Shih:Scholar><Hao:Hero>   <<<
<<< Institute of CSEE, National Central Univ, Chungli, Taoyuan, Taiwan, ROC >>>
>>> Internet:	oper7@mbox.ee.ncu.edu.tw	 oper2@ncuee.ncu.edu.tw	    >>>
Newsgroups: comp.lang.c++
From: pramesh@bhaskara.webo.dg.com (Ramesh Babu)
Subject: Re: How to limit string output length w/ stream manips?
Date: Fri, 8 Jan 93 21:12:51 GMT
Reply-To: pramesh@bhaskara.webo.dg.com
Organization: NSDD, Data General Corp.

In article <1993Jan8.183239.10873@taumet.com>, steve@taumet.com (Steve Clamage) writes:
|> af458@yfn.ysu.edu (Jon K. Salmon) writes:
|> 
|> 
|> >I would like to limit the output length of a string sent to an
|> >output stream.  For example, given a string...
|> 
|> >  const char *Bob = "1234567890ABCDEF";
|> 
|> > ... to output "12345"?
|> 
|> As with printf(), the iostream inserters never truncate a value; output
|> width is a minimum, not an absolute.
|> 
|> If you want to truncate a string, you have to do the truncation yourself.
|> -- 
|> 
|> Steve Clamage, TauMetric Corp, steve@taumet.com

In C printf with a format string, the above functionality can be
implemented. Refer to pg 153 of K&R 2nd edition.

Example:

      printf ( "%2.2s\n", "ABCD" );

will output just

      AB
in "%2.2" the first 2 specifies the min length and the second 2 
the max length. The first 2 can be omitted then the format string
becomes "%.2" will have the same desired results.

***********************************************************************
Ramesh babu P                   pramesh@ox.webo.dg.com
Data General Corp.
Westboro, Ma (508)-870-8048      Fax (508)-898-4212
***********************************************************************
From: ac690@cleveland.Freenet.Edu (Edward Klimas)
Newsgroups: comp.lang.c++
Subject: Re: feedback wanted on appropriate OOPL
Date: 12 Jan 93 06:28:25 GMT
Reply-To: ac690@cleveland.Freenet.Edu (Edward Klimas)
Organization: Case Western Reserve University, Cleveland, OH (USA)
NNTP-Posting-Host: slc4.ins.cwru.edu


In a previous article, erc@netcom.com (Eric Smith) says:

>In article <TMB.93Jan10170408@arolla.idiap.ch> tmb@idiap.ch writes:
>>It is only true to say that _at compile time_, C++ will catch more
>>programmer errors than Smalltalk.
>>
>>If you take into account both compile time and runtime, Smalltalk will
>>catch more "programmer errors" than C++: not only will Smalltalk catch
>
>But when is runtime?  When the program starts running, or when it
>encounters unusual data several years after it's put into production?
>
>The advantage of compile time error detection is that all the errors
>that can be caught by the compiler are caught before the program is
>released.
	The message at OOPSLA-92 from two separate experience reports
	was that Smalltalk was possibly as much as an order of
	magnitude better than C/C++ in terms of quality of the resulting
	code.  The result is that the current implementations of
	type checking don't bring as much to the quality table as other
	C++ issues like runaway pointers and memory management take away.
Newsgroups: comp.lang.c++
From: lightw@cetra.trl.OZ.AU (Liron Lightwood)
Subject: RE: C++ 3.01 templates problem.
Summary: It's a bug!
Keywords: C++ templates bug
Organization: Telecom Research Labs, Melbourne, Australia
Date: Wed, 13 Jan 1993 05:40:55 GMT

Earlier I posted a problem regarding a possible bug with C++ 3.01
templates, in which the following compiler error occurs.

---
"/usr/users/lightw/IN/src/SMS/mgmt/a.c", line 25: error: bad argument  1 type for  GetFunc <x, int >::GetFunc__pt__4_1xi(): int (x::*)() ( int (x::*)() expected)
---

I have received several mail replies indicating that this is a bug in 
cfront 3.01!!!  They said that it is fixed in cfront 3.0.2.  Is this
available?

I have also been told that the problem extends to other uses of function
pointers inside template classes.  For example, assining such a pointer to
0.

Thanks to all those who have replied.

P.S.  Here is the reprint of the code which causes the bug.
-----------------------------

class x  
{
    public:
    int x_int() { return 21; }
         // fff is a member function of class x which returns an
         // integer
};
 
int ft()
{
    return 22;
}

template <class A,class B> class GetFunc {
public:  
   B (A::*a_b_func)();  
        // func contains address of a member function of class B 
        // (e.g. class x) which returns an A (e.g. an int)    
 
   GetFunc(B (A::*f)()) : a_b_func(f) {}  // constructor
};
 
main()   
{
    GetFunc<x,int> getfunc_x_int ( &(x::x_int) ); 
}

---------------------------------------------------

Liron Lightwood                     Internet : r.lightwood@trl.oz.au
Telecom Research Laboratories       Phone : +61 3 253 6535
770 Blackburn Road                  Snail : P.O. Box 249 Clayton 3168 Australia
Clayton  Vic. 3168 Australia        Disclaimer : My views are not my company's