HDTenEightyP/NetNews huggingface dataset:
From: shang@corp.mot.com (David (Lujun) Shang)
Subject: Re: The concept of templates considered ill designed
Reply-To: shang@corp.mot.com
Organization: Motorola, Inc., Software Research and Development, Rolling Meadows, IL. 60008
Date: Wed, 7 Oct 92 15:53:29 GMT

In article <1992Oct6.174129.10404@genghis.borland.com> pete@genghis.borland.com  
(Pete Becker) writes:
> 	I seem to have not made myself clear.  What I was responding to was
> the claim that constrained parameters ALLOW THE TEMPLATE DEFINITION TO BE
> COMPILED INDEPENDENTLY OF ANY PARTICULAR INSTANTIATION.  While that's
> certainly true, it offers very little beyond what's currently available
> without using templates, precisely because the compiler knows nothing about
> the actual types of the template parameters.

I'm afraid I misunderstand what you claimed here. I can't understand 
this statement: "it offers very little beyond what's currently available
without using templates, precisely because the compiler knows nothing 
aboutthe actual types of the template parameters", would you offer an 
example? I refer "it" in your statement to a constrained parameterized 
class (template). If the class parameter is constrained, the compiler 
should know a partial interface of the parameter, and all the usage of 
the parameter should obey the protocol described in the partial interface. 
If you need to know the further detail about the interface, you can 
re-constrain (narrow) the parameter in the derived classes. That is the 
specialization, which I view a mechanism as useful as inheritance.

Constrained parameterized classes offer much more than separate 
compilation. I just list a few more points here:

1. It supports specialization and covariant specification;
2. It supports polymorphism (dynamic binding) based on parameterization;
3. It supports more precise interface specification (type dependency);
4. It supports code reuse not only at the source level, but also at the 
   machine code level.

> 	If you want constrained templates AND independent compilation of
> template definitions, you've already got it.  But don't call it a template.
> Call it a forwarding class.

Exactly. See, I call it a constrained parameterized class and never 
call it a template. In fact, a constrained parameterized class IS a 
class, it can be used anywhere as an abstract class is used. Therefore, 
it is NOT a template. For exmaple:

  class < class MemberT[GroupMember] > Group {...};

You can use Group to declare a pointer or a function argument:

  Group * group;
  group = new Group <class MemberT=SomeMemberType> (...);

or,

  void foo (Group & group);

You cannot use template this way.

The same case with constrained parameterized function:

  <Group GT> GT.MemberT select_one (const GT & group);

and "select_one" can be called directly: "select_one(aDogGroup)" will return a  
dog; "select_one(aCatGroup)" will return a cat.

David Shang

Newsgroups: comp.lang.c++
From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
Subject: Re: streams
Organization: Computer Science, University of Melbourne, Australia
Date: Thu, 15 Oct 1992 14:49:06 GMT

kanze@us-es.sel.de (James Kanze) writes:

>In <Bw2CnI.LpB@news.cso.uiuc.edu>, Mike Krupicka writes:
>
>|> I am writing some code where I would like to be able to read in either from
>|> stdin or from a file. What I want to know is how do you initialize the stream,
>|> and pass it to a common var. I tried something like the following and had
>|> problems because the code was local only to the if statement.
>
>|> main(){
>|> .
>|> .
>|> if (stdflag)
>|>  ostream& fin = cin;
>|> else
>|>  ofstream& fin("test.in");
>
>|> Any ideas?
>
>Somebody's sure to point out a better way, but it can be done with a
>pointer, ie:
[pointer example omitted]
>For that matter, you could probably do:
>
>    main()
>    {
>        ostream&        fin = stdflag ? cin : new ofstream( "test.in" ) ;
There should be an '*' before the 'new' here, ie.
         ostream&        fin = stdflag ? cin : *new ofstream( "test.in" );
>        //  ...
>        if ( ! stdflag )
>            delete *fin ;           //  Close file
This should be '&' instead of '*', ie
	     delete &fin ;
>    }
>
>Which one you prefer is a matter of taste.

An approach that may be better in many cases is just to pass the
appropriate stream to a function that takes a reference argument:

	void do_it(ostream &out) { ... }

	main() {
	    ...
	    if (stdflag)
	        do_it(cin);
	    else
	        do_it(fin("test.in"));
	}

-- 
Fergus Henderson             fjh@munta.cs.mu.OZ.AU      
This .signature virus is a self-referential statement that is true - but 
you will only be able to consistently believe it if you copy it to your own
.signature file!
Newsgroups: comp.lang.c++,comp.std.c++
From: davisonj@en.ecn.purdue.edu (John M Davison)
Subject: SUMMARY: include files likely to be in the ANSI standard
Followup-To: comp.std.c++
Summary: summary of replies I've received
Keywords: include file C++ iostream strstream fstream ANSI
Organization: Purdue University Engineering Computer Network
Date: Fri, 9 Oct 92 03:20:29 GMT


        Thanks to those mentioned below for shedding light on the issue.

-------------------------------------------------------------------------------
Date: Mon, 5 Oct 92 09:56:55 PDT
From: jss%summit@lucid.com (Jerry Schwarz)

...

[The 15 filenames that follow are from the ANSI standard for C]

|> <assert.h>
|> <ctype.h>
|> <errno.h>
|> <float.h>
|> <limits.h>
|> <locale.h>
|> <math.h>
|> <setjmp.h>
|> <signal.h>
|> <stdarg.h>
|> <stddef.h>
|> <stdio.h>
|> <stdlib.h>
|> <string.h>
|> <time.h>

x3j16/wg21 has accepted the C library essentially as is.

|> 
|> <complex.h>
|> <fstream.h>
|> <iostream.h>
|> <new.h>
|> <stream.h>               <-- obsolescent, of course
|> <strstream.h>
|> 

new.h will be there (its already mentioned in the body of
the working paper)

iostream.h, fstream.h, strstream.h are under serious consideration
and will almost certainly be there, except that they may
be named "iostream", "fstream" and "strstream".  That is
there is some discussion of dropping the ".h".  

complex.h will almost certainly not be there. 
-------------------------------------------------------------------------------
From: jss%summit@lucid.com (Jerry Schwarz)

...

There were a bunch of nits that had to be changed. 
        some stuff in setjmp/longjmp

        different approach to identifier reservation and linkage
        ... this is likely to change again

        wchar_t is a builtin primitive data type rather than a 
        typedef.

        Description of exit changed, 

        Some declarations were changed to be "const correct". E.g.
        strchr became overloaded.

                const char* strchr(const char*, int) ;
                char* strchr(char*,int) ;

        
        etc.

__STDC__ isn't a library issue.  

-------------------------------------------------------------------------------
Steve Clamage, TauMetric Corp, steve@taumet.com
Vice Chair, ANSI C++ Committee, X3J16

...

Iostreams will be part of Standard C++, but not all the details have
been worked out.  I doubt that <stream.h> will be part of the Standard.

Complex has not so far been mentioned for inclusion in Standard.

There will probably be a string class and a bitset class in the Standard.

I think you can rely on individual implementations continuing to
provide the same headers and libraries they currently provide for
compatibility.
-------------------------------------------------------------------------------
-- 
John Davison
davisonj@ecn.purdue.edu
From: mmuhamad@eniac.seas.upenn.edu (Mohd Zaki Muhamad)
Newsgroups: comp.lang.c++
Subject: Help me...
Summary: graphic.h?? initgraph??
Date: 13 Oct 92 18:53:53 GMT
Organization: University of Pennsylvania

To whom it may concern..

      I tried to run this program which I copied directly from my textbook
and it was supposed to show graphics of a circle and a line ...
but in my user-screen I saw nothing??
can someone help me with this?  or please send me a brief example of how
to use these functions ==> initgraph(), line()??

#include <graphics.h>
void main(void)
{
 int driver, mode;
int x1=0, y1=0;
int x2=199, y2=199;
int xc=100, yc=100;
int radius = 90;

driver =CGA;
mode = CGAC0;
initgraph(&driver, &mode, "C:\\tc\\bgi");
line(x1, y1, x2, y2);
circle(xc, yc, radius);
getche();
closegraph();
}

Newsgroups: comp.lang.c++
From: es@peanuts.informatik.uni-tuebingen.de (Endric Schubert)
Subject: ctrace for C++/G++ needed
Organization: "Lehrstuhl fuer Technische Informatik, Uni Tuebingen"
Date: Thu, 8 Oct 92 18:50:55 GMT


to debug C++ code on my SUN4, i need something like `ctrace' for C++, since
the original ctrace can't proceed on C++ sources :(

please post or email info to me, thanx
-- 

                     Endric Schubert
                  Universitaet Tuebingen
           Lehrstuhl fuer Technische Informatik
                        Sand 13
                 7400 Tuebingen, Germany
From: Andrew.Koenig@f1.n100.z60.wlink.nl (Andrew Koenig)
Newsgroups: comp.lang.c++
Subject: NIHCL
Date: Tue, 13 Oct 1992 05:01:05 -0100

Organization: AT&T Bell Laboratories, Murray Hill NJ

In article <zen.718913004@texas> zen@syl.dl.nec.com (zen kishimoto) writes:

> I have a question regarding the use of NIH.  We are considering to use NIH
> for our product.  Now if we use NIH as is, can we sell the end product
> without any problem?

NIHCL is a `US Government Work.'  That means it is in the public domain,
it is not, and cannot be copyrighted, and anyone may use it for any purpose.
-- 
				--Andrew Koenig
				  ark@europa.att.com

Newsgroups: comp.lang.c++
From: dak@tabaqui.informatik.rwth-aachen.de (David Kastrup)
Subject: Arrays for lists? Was: Sigh. So, what is a proper class definition ?
Organization: Rechnerbetrieb Informatik  /  RWTH Aachen
Date: 11 Oct 92 17:10:00 GMT

Here some people where discussing implementing lists as arrays with
insert and delete operations.

Well lists have certain properties. As long as you keep them mostly
fixed or static, implementation as an array is ok.

The moment the basic list operations of inserting, deleting, consing
up a list (sorry for my lisping), tackling a list from the head and
so on determine the operation count, implementation as an array is
gruesomely inefficient.

I have a sort routine working on simple linked lists (basically
a refined mergesort, where sorting one sublist is combined with skipping
to the next sublist) which beats the library qsort routines (for
TC++) by a factor of 2 easily. If the basic list operations
of growing a list, shrinking a list etc would be imitated by
arrays, the performance would be absolutely horrible!!

If you implement an abstract class in a unusual way, you should make
sure that ALL the basic operations are done without indiscussable
overhead. And lists have basic operations of access (getting this,
getting next) as well as creation (hanging on after this).
Newsgroups: comp.lang.c++
From: karl@ncrspks.SparksNV.NCR.COM (Karl Held)
Newsgroups: comp.lang.c++
Subject: Borland 3.1 nested comment highlighting problem.
Date: 7 Oct 92 14:26:48 GMT
Reply-To: karl@ncrspks.SparksNV.NCR.COM (Karl Held)
Distribution: world
Organization: NCR Corporation, FESC 778 Sparks

My apologies if this topic has already been covered. Highlighting of nested
comments under Borland C 3.1 does not extend beyond the innermost comment.
Everything between the initial comment and the end of the most nested comment
is properly highlighted. The rest of the comments beyond the innermost comment
is not highlighted. Is anyone aware of a patch to fix this problem? Please
respond by email, if possible. Thanks in advance.
From: secrist@hpspkla.spk.hp.com (Mark S. Secrist)
Newsgroups: comp.lang.c++
Subject: Re: Question: Can I embed SQL in C++
Date: 8 Oct 92 19:50:50 GMT
Article-I.D.: hpspkla.27590002
Organization: Hewlett Packard Company, Spokane, Wa.

In comp.lang.c++, cmlow@iti.gov.sg (Low Chee Meng (KSL)) writes:

 >  Hi,

 >  I would like to know if anybody has any experience/success writing
 >  embedded SQL statements inside a C++ program.

 >  We have an Informix database and a ESQL pre-processor meant
 >  for C. According to the local agent from Informix, the SQL
 >  pre-processor works only on C files, not C++ files. 
 >  We intend to use GCC as our C++ compiler, but we do not know
 >  how to make the pre-processor work with GCC.

 >  Is there any way to work around the abovementioned problem? 

 >  Please reply by e-mail if possible. 

 >  Thanks

 >  Chee Meng

I am interested in this as well.  I have already written an sql module in
embedded SQL C and used C++ to create objects which would interface with
the SQL code.  It would have been much more efficient had I been able
to include the SQL code inside the member funcions for the objects.

My preference would be to post any information here for all to benefit.

Thanks,

Mark Secrist
Newsgroups: comp.lang.c++
From: frank@Cookie.secapl.com (Frank Adams)
Subject: Re: Proposal: Preconditions and PostConditions in C++
Date: Wed, 14 Oct 1992 22:01:38 GMT
Organization: Security APL, Inc.

In article <1992Oct14.163846.1539@genghis.borland.com> pete@genghis.borland.com (Pete Becker) writes:
>       class Base
>       {
>	    virtual void g();
>	public:
>	    void f() { g(); }
>	    void h();
>	};
>
>	class Derived : private Base
>	{
>	    virtual void g();
>	public:
>	    Base::f;
>	};

How about:
       class Base
       {
	   virtual void g();
       public:
	   void f() { g(); }
	   void h();
       };

       class Derived : public Base
       {
       public:
	   virtual void g();
       };

       class New
       {
	   Derived x;
	   virtual void g() {x.g();}
       public:
	   virtual void f() {x.f();}
       }
Newsgroups: comp.lang.c++
From: bruceb@ctpm.uq.oz.au (Bruce Blackshaw)
Subject: loading icons
Summary: Assigning an icon to an application
Keywords: icons
Organization: Centre for Language Teaching and Research, Uni of Queensland, AUSTRALIA.
Date: 14 Oct 92 01:54:32 GMT

I am having trouble assigning a custom made icon to a Windows 3.1
application I have written, in BC++.  I have referenced the .ico
file in the .rc file, but when I try to load the icon something
goes wrong.  I have a user defined window called TMidgeWindow, and
I override GetWindowClass as in below:

   void TMidgeWindow::GetWindowClass(WNDCLASS& wc)
   {
     TWindow::GetWindowClass(wc);
     wc.hIcon = LoadIcon( GetApplication()->hInstance, "MG_ICON" );
   }

This is all using ObjectWindows of course.  The problem is, once I
have created my .exe file and created a new item in Program Manager,
the icon I have chosen (MG_ICON) *does* appear, BUT when I run the
application and minimize it, it does NOT appear - instead I get the
blank (default DOS?) item.  I would appreciate some mail on this
problem.

Bruce Blackshaw.

--
****************************************************
Bruce Blackshaw bruceb@ctpm.uq.oz.au   
"... I'd rather be hang gliding ..."
****************************************************
Newsgroups: comp.lang.c++
From: male@eso.mc.xerox.com (Ron Male 73628 - SST/SETA)
Subject: Boolean Tests on Streams
Reply-To: male@eso.mc.xerox.com
Organization: Xerox Corporation, Webster NY
Date: Fri, 9 Oct 1992 18:56:47 GMT

There seem to be two elementary approaches to performing boolean tests
on streams:

1)  while (cin >> ch)
       {...}

2)  if (cin)
       {...}

I've been unsuccessfully trying to find out what is going on under
the hood in these cases.  How are the tests being made?   I read somewhere
that for case #1, after every I/O operation, a test of the ios::state buffer
is made for the stream reference that is returned from ios::operator >> (), and
I bought that explanation.  But in case #2, there is no formal operation being
performed before the boolean test occurs.  So that means something more is going
on than I am aware of.  I'd like to learn the specifics simply so that I can
use the feature in a knowledgable fashion.
Organization: University of Maine System
Date: Wednesday, 7 Oct 1992 20:57:07 EDT
From: <IO00933@MAINE.MAINE.EDU>
Newsgroups: comp.lang.c++
Subject: GNU C++

A quick question :

Where can I get the Gnu C++?

Your response is appreciated.

With regards

Michael Chen
From: rct@fulcrum.bt.co.uk (Richard Taylor)
Newsgroups: comp.lang.c++
Subject: Re: Another Good C++ Book!
Date: 12 Oct 92 09:38:46 GMT
Organization: Fulcrum Communications

In article <1992Oct10.152618.5182@cs.brown.edu> sdm@cs.brown.edu (Scott Meyers) writes:
>
>I'm glad you like the book.  There is currently a project at Brown
>University that is working on the development of a lint++-like tool, but it
>will offer much more power than lint, because you'll be able to write your
            ^^^^^^^^^^^^^^^^^^^^^^^^^
>own constraints and then have the system look for violations.  For more
>information, take a look at this paper:
>

See the pre- and post-conditions discussion elswhere in this newsgroup!

Regards,

============================================================================
Richard Taylor                 DoD #981               (rct@fulcrum.bt.co.uk)
"Would you trust a company who have their bits reversed?".
============================================================================
Fulcrum Communications Ltd., Fordrough Lane, Birmingham, B9 5LD, ENGLAND.
Newsgroups: comp.lang.c++
From: torstein@itekiris.kjemi.unit.no (torstein hansen)
Subject: Re: BC++ 3.0 TDW and Windows 3.1
Organization: Dept. of Chem.Eng, Norwegian Inst. of Tech
Date: 9 Oct 92 13:53:09

In article <1992Oct6.164007.5032@mksol.dseg.ti.com>
  mccall@mksol.dseg.ti.com (fred j mccall 575-3539) writes:
   In article <tpenttin.718029822@majakka.uku.fi> tpenttin@majakka.uku.fi (Tommi Penttinen) writes:
   >"Can't load WINDEBUG.DLL". That's what my TDW tells me when I try to debug
   >anything.. And I'v put WINDEBUG.DLL on the dos command path as told in a
   >readme file on the distribution disk. So, what's the problem? Doesn't
   >BC++ 3.0's Turbo Debugger for Windows work with Windows 3.1?

   No, it doesn't.  There was at one time a patch for this, but now the
   suggested fix is to update your compiler suite to the current version.

   [I don't know if Borland is still providing the patch to 3.0 users or
   not -- I never got the patch; I merely waited for the new release.]

I got the same problem using Turbo Pascal for Windows. There is an
updated WINDEBUG.DLL in the file tpwin31.zip at ftp.cica.indiana.edu.
I checked one of its mirror sites and it was there today. The path at
cica is:

/pub/pc/win3/programr/tp/tpwin31.zip

By the way, if anyone has trouble with WinSight try getting wsupd1.zip
from cica at /pub/pc/win3/programr/bcpp/wsupd1.zip

If the files has been removed, would anyone give me a note?

Hope this will help.

torstein
torstein@itekiris.kjemi.unit.no
Newsgroups: comp.lang.c++
From: nikki@trmphrst.demon.co.uk (Nikki Locke)
ReplyTo: nikki@trmphrst.35demon.co.uk
Subject: Re: My objects are too big - why?
Distribution: world
X-Mailer: cppnews $Revision: 1.19 $
Organization: Trumphurst Ltd.
Date: Wed, 14 Oct 1992 19:50:28 +0000


In article <1992Oct13.103316.14885@stiatl.salestech.com> ges@stiatl.salestech.com (Gerald Sullivan) writes:

> nikki@trmphrst.demon.co.uk (Nikki Locke) writes:
> > ... at least two of the most popular MsDOS-based C++ 
> >compilers do not implement them properly, so that mixins do not work 
> >correctly.
> 
> Could you please elaborate what is improper? 
> I have used Zortech 2.0 and Borland 3.0. I am currently using Borland. 
> I use abstract classes as mixins extensively. 
> 
> I have had no known problems.
I refer you to the example I posted earlier. This won't compile under 
Borland, and causes a horrible crash under Zortech.

I include a much shorter example, that illustrates the problem ...

class A { public: virtual void foo()=0; };
class B : public virtual A {};
class C : public virtual A { public: void foo(){} };
class D : public B, public C { };
D d;

Borland won't compile this (says D is abstract).

---
Nikki Locke,Trumphurst Ltd.(PC and Unix consultancy) nikki@trmphrst.demon.co.uk
trmphrst.demon.co.uk is NOT affiliated with ANY other sites at demon.co.uk.
Newsgroups: comp.lang.c++
From: steve@taumet.com (Steve Clamage)
Subject: Re: need help: istream vs. fscanf
Organization: TauMetric Corporation
Date: Thu, 15 Oct 1992 20:37:27 GMT

hartman@ulogic.UUCP (Richard M. Hartman) writes:


>another programmer here produced this code:

>	cin >> i1 >> ',' >> i2;

>to my suprise the compiler did NOT complain ...

>and I would have expected the compiler to complain about the
>literal (const) character (',') being passed to the '>>' operator.


>1) can someone explain why this line compiled?
>2) what it would actually do? (it does not require a comma
>   but it does seem to require either a comma or a newline
>   between the two numbers)


The type of a literal character is "char", not "const char", so the
function
	istream::operator>>(char&)
is called.  Because a literal does not have an address, the compiler
creates a temp of type char, assigns the value of the literal to it,
and then calls the function.  (Some compilers warn you about the
temp.)

The resulting code is exactly equivalent to this:
	char temp = ',';
	cin >> i1 >> temp >> i2;

This violates the current language definition, according to which the
original code is in error.  Many current compilers continue to create
the temp for compatibility with older code.
-- 

Steve Clamage, TauMetric Corp, steve@taumet.com
Vice Chair, ANSI C++ Committee, X3J16
From: books@fsunuc.physics.fsu.edu (Roger Books)
Subject: Re: GNU C++
Organization: FSU nuclear physics
Date: Mon, 12 Oct 92 13:09:11 GMT

In article <718683837snx@trmphrst.demon.co.uk> nikki@trmphrst.demon.co.uk (Nikki Locke) writes:
>Newsgroups: comp.lang.c++
>From: nikki@trmphrst.demon.co.uk (Nikki Locke)
>Path: mailer.cc.fsu.edu!gatech!destroyer!uunet!pipex!demon!trmphrst.demon.co.uk!nikki
>ReplyTo: nikki@trmphrst.35demon.co.uk
>Subject: Re: GNU C++
>References: <RICK.92Oct8105307@mel1.geg.mot.com>
>Distribution: world
>X-Mailer: cppnews $Revision: 1.19 $
>Organization: Trumphurst Ltd.
>Lines: 19
>Date: Fri, 9 Oct 1992 19:23:57 +0000
>Message-ID: <718683837snx@trmphrst.demon.co.uk>
>Sender: usenet@gate.demon.co.uk
>
>In article <RICK.92Oct8105307@mel1.geg.mot.com> rick@mel1.geg.mot.com (Rick Rankin) writes:
>
>> In article <92281.205707IO00933@MAINE.MAINE.EDU> <IO00933@MAINE.MAINE.EDU> writes:
>> 
>>    Where can I get the Gnu C++?
>> 
>> GNU C++ and all other GNU software is available from prep.ai.mit.edu.
>> Look in /pub/gnu.  The current version of GNU C++ is in
>> gcc-2.2.2.tar.Z (C and C++ in one).  You will also want the C++
>> library in libg++-2.2.tar.Z
>Who do you mail if you want to buy a tape of GNU C++ ? I am reluctant to 
>download the many MB of GNU stuff at long-distance phone rates.
>---

	Free Software Foundation
	675 Massachusetts Avenue
	Cambridge, MA 02139, USA
	(617)876-3296

>Nikki Locke              |                        | nikki@trmphrst.demon.co.uk

Roger
books@fsunuc.physics.fsu.edu
From: agrafiot@wl.com (Dimitris Agrafiotis)
Newsgroups: comp.lang.c++
Subject: ftp sites for C++ class libraries
Date: 9 Oct 92 21:20:02 GMT
Article-I.D.: wl.1992Oct9.212002.14971
Organization: Warner Lambert / Parke-Davis


Does anyone have a list of ftp sites with c++ software?
Thanks

-- 
Dimitris K. Agrafiotis
Computer Assisted Drug Design
Parke-Davis Pharmaceutical Research
(agrafiot@wl.com)
Newsgroups: comp.lang.c++