HDTenEightyP/NetNews huggingface dataset:
Newsgroups: comp.lang.c++
Subject: use window functions?
From: belliot@eis.calstate.edu (Brett Elliott)
Date: Sun, 8 Nov 1992 05:47:41 GMT
Organization: Calif State Univ/Electronic Information Services

I'm a beginner here... how would I go about using windowing
functions(windows 3.1) in C++?  And, what are the latest versions of C++,
Microsoft and Borland?

Newsgroups: comp.lang.c++
From: sasghm@theseus.unx.sas.com (Gary Merrill)
Subject: A template or not a template?
Originator: sasghm@theseus.unx.sas.com
Date: Thu, 5 Nov 1992 19:51:55 GMT
Organization: SAS Institute Inc.
Keywords: templates


Well, I've unearthed a copy of the second edition of Lippman
and find it to be quite good in general (I'll omit any minor
criticisms I may have at this point).  I've been looking at it
pretty closely (in conjunction with other stuff) and trying to
extract a semantics for templates.  In the process, the following
(admittedly perverse) example occurred to me:

	template <class T> class Foo {
		// Doesn't much matter what's here
		T x;
		};

	template <class T> class Foo<int> {
		// Likewise
		T *p;
		};

Now clearly the first is a template-declaration.  So is the
second!  Note that since 'Foo' is a template-name, then
'Foo<int>' is a template-class-id (I'm using stardard and ARM
terminology here).  Indeed,

	class Foo<int> {
		// Likewise
		T *p;
	};

would appear to be a *specialized instance* (Lippman terminology).
Certainly it has to be counted as a *declaration* if


	class Foo {
		// Doesn't much matter what's here
		T x;
		};

is a declaration (which it is).  In short, the second apparent
template-declaration follows the grammar and violates no constraints
I have seen anywhere.

But what does it *mean*?  Moreover, what does the use of the new
template-name ('Foo<int>') mean in various contexts?  Consider,

	Foo<char> c;  // unproblematic

	Foo<int><double> d;  // Likewise unproblematic, I think.

	Foo<int> i;	// ?????

Apparently I am not alone in my confusion.  The latest version of
g++ accepts both template-declarations.  It handles nicely the
declaration of 'c' above.  On both of the other two declarations
it suicides with an "Internal compiler error".

Do we perhaps need to tighten up the syntax of template declarations
a bit?  Any thoughts?

-- 
Gary H. Merrill  [Principal Systems Developer, C Compiler Development]
SAS Institute Inc. / SAS Campus Dr. / Cary, NC  27513 / (919) 677-8000
sasghm@theseus.unx.sas.com ... !mcnc!sas!sasghm
Newsgroups: comp.lang.c++
From: frank@Cookie.secapl.com (Frank Adams)
Subject: Re: Const Inheritance
Date: Thu, 05 Nov 1992 16:26:47 GMT
Organization: Security APL, Inc.

In article <1992Oct28.172457.98060@Cookie.secapl.com> frank@Cookie.secapl.com (Frank Adams) writes:
>I was playing around with some ideas the other day, and came with an idea
>which seems interesting to me.  [...]
>
>If there were some way to inherit only the const virtual functions [...]
>
>  class Square : public const Rectangle, public virtual Shape {...};
>
>
[...]

On further consideration, I think this proposal does not go far enough.

What is really happening here is that, in many ways, const Foo is a separate
class from Foo.  It is different for determining which overloaded function
to invoke, and it produces a different type when pointed to.

What I propose is that const Foo be made fully a separate class from Foo.
This would include the proposal above as an immediate consequence.  It means
that each class Foo is a subclass of const Foo, so that when we have a class
definition:

    class Bar : public Foo ...

we are implicitly defining a multiple inheritance matrix:

	const Foo
	 /     \
   const Bar   Foo
	 \     /
	  \   /
	   Bar

Also, I am not sure whether the ARM now allows:

    class Foo
    {
	public:
	int bar();       // called for non-const objects
	int bar() const; // called for const objects
    }

If not, this would also follow from this proposal.

I believe it is now legal to define:

    const class Bar : public Foo ...

meaning that all the members are const.  For a Bar declared this way, const
Bar would identically the same class as Bar (so a pointer to const Bar would
be the same type as a pointer to Bar).  Such a Bar would implicitly inherit
only from const classes; so the above would be equivalent to specifying only
const Foo as a superclass.

(If cast-away-const remains in the language, this provides a way for a
Square which inherits from const Rectangle to invoke a non-const Rectangle
function.  If some safer alternative replaces it, it would be valuable to
have it able to support this kind of construct as well.)
Newsgroups: comp.lang.c++,comp.object,comp.ai.neural-nets
From: krus@cs.concordia.ca (Mike Krus)
Subject: Neural Networks and OO
Organization: Computer Science, Concordia University, Montreal, Quebec
Date: Sat, 7 Nov 1992 23:51:26 GMT

Hi,

can anybody tell me what are good books/articles/references/anythings who
relate Neural Networks and the Object Oriented paradigm.

Thanks in advance,

-- 
Michael Krus.					 Email : krus@cs.concordia.ca
Concordia University				Universite d'Orsay - Paris XI
Montreal, Canada					        Paris, France
Entropy isn't what it used to be.
Newsgroups: comp.lang.c++
From: mj@lpi.liant.com (MJ Franzago)
Subject: Re: What compliers are available for SCO/386 UNIX ?
Reply-To: mj@lpi.liant.com	
Organization: Liant Software Corporation, Framingham MA	
Date: Wed, 11 Nov 1992 23:51:35 GMT

In article <1992Nov10.200231.20919@nntpd2.cxo.dec.com>, jimw@empros.cxn.dec.com (Jim West) writes:
|>   I am looking for any info on available compilers for SCO UNIX on 386/486
|> machines.

Liant provides a C++ compiler for the i386/i486 SCO Unix platform;
this comes bundled with CodeWatch, an X/Motif C++ source-level 
debugger.  We have just released version 1.1 on both SCO and Interactive.
This release has numerous bug fixes, compile-time speed improvements,
and debugger enhancements.

For more information, contact info@lpi.liant.com, or call 
(508) 872-8700.

--------------------------------------------------------------------
   MJ Franzago                       mj@lpi.liant.com 
   Liant Software Corporation        tel: (508) 872-8700
   Framinghan, MA 01760 USA          fax: (508) 626-2221
--------------------------------------------------------------------
Newsgroups: comp.lang.c++
From: glp@fig.citib.com (Greg Parkinson)
Subject: Re: Where can one buy an elegant and efficient library?
Originator: glp@merlin
Organization: Citibank IBISM
Date: Thu, 5 Nov 1992 17:34:29 GMT


In article <1992Nov4.195145.25517@mprgate.mpr.ca>, janzen@lichen.mpr.ca (Martin Janzen) writes:
 
|> Well, there's COOL, from Texas Instruments.  It's available by anonymous FTP from
|> ti.com, in /pub/COOL.tar.Z.  I've downloaded it and built it, but haven't tried it
|> out yet.  There's no support, but the price is right.

We've been working with COOL for a while and abandoning
it (probably in favor of the Standard Components.)  It's
proving to be much to difficult to upgrade it to use
templates.

-- 
Greg Parkinson                  Phone: 212-657-7814  Fax: 212-825-8607
Citibank,111 Wall Street        E-Mail: glp@fig.citib.com
New York, New York  10043
The opinions expressed are my own and not those of the big 'ol bank.
Newsgroups: comp.lang.c++
From: erc@netcom.com (Eric Smith)
Subject: Re: WANTED: A SOURCE CODE based C++ class browser for MS Windows.
Keywords: c++ browser 
Organization: Netcom - Online Communication Services (408 241-9760 guest)
Date: Tue, 10 Nov 1992 13:37:26 GMT

In article <1992Nov9.203226.26681@is.morgan.com> jlieb@is.morgan.com (Jerry Liebelson) writes:
>Does anyone know a good C++ class browser for MS Windows that will
>browse source code in multiple header and source directories? I don't
>want to buy another compiler, just need the browser.  Such a class
>browser should do the following:
>
>   1. Let you specify a list of include and source directories and
>optional preprocessor #defines and see something like a FileManager-like
>class hierarchy tree.
>   2. Then by clicking on any class, selectively list all/some/none inherited
>methods and data by indicating how far up the inheritance tree to show.
>   3. In addition, selectively show any combination of
>public/private/protected and virtual/const/static functions and data.
>   4. By clicking any particular method or data, see its complete declaration
>and definition.
>
>When I purchased Borland's C++ with App Frameworks, I was rather shocked
>that the builtin class browser only worked on executables. I like what
>Borland has done but honestly, any good OO development environment, C++
>or otherwise, should have a class hierarchy browser for use with source code.
>After all, code comes before executable!
>
>
>-- 
>Jerry Liebelson
>jlieb@is.morgan.com
>Compuserve: 73477,2740
>


I would like to know too, because I am going to be implementing one soon
and would like to compare it with others.  I would also like to know what
features people most want, etc.

The feature most important to me is speed of accessing symbols, etc.  For
example, if I select foo, I want to be able to instantly pop up the
definition of foo, and to go there and select bar and pop up its definition.
Any delays in accessing definitions would in my opinion make it a much
lower quality browser, so that is my top priority, even if it means mine
will require more memory than some others.

A C++ class browser is a lot more complicated to implement than it sounds,
but I already have most of the work done, effectively, because I have
been working on other programs which share a lot of the same functionality.
The main complexity is in parsing/indexing the C++ code such that it can be
located instantly when needed.  It needs to keep track of the type and scope
of every name it sees, and be able to retrieve that information fast.  Macros
complicate it too by making it keep track of the names seen before and after
preprocessing, and still be able to locate the original source code instantly
whenever a name is selected.

But the complicated parts mentioned above are the parts I have effectively
already done, so the rest is just a matter of getting enough time to
implement it, because I'm working on a couple of other programs first, which
also share a lot of the same functionality.
Newsgroups: comp.lang.c++
From: nikki@trmphrst.demon.co.uk (Nikki Locke)
Subject: Re: Microsoft C/C++ version 7 memory glitch
Reply-To: nikki@trmphrst.demon.co.uk
Distribution: world
X-Mailer: cppnews $Revision: 1.20 $
Organization: Trumphurst Ltd.
Date: Thu, 5 Nov 1992 12:22:49 +0000

In article <92Nov02.183738.28361@acs.ucalgary.ca> gerke@acs.ucalgary.ca (Ken Gerke) writes:
> 
> Someone brought in some C++ code to my office today that tries to
> allocate the same chunk of memory twice.  It just uses regular
> calls to the 'new' function and is built with the medium memory
> model.  Trivial, seemingly unrelated changes make the problem
> disappear, but don't give us a lot of confidence that the problem
> has been solved.  Anyone out there have a guess where to find a
> more certain answer?
Usually caused by freeing a pointer not allocated with malloc, or deleting
a pointer not allocated with new, or using the wrong one of "delete []" and
"delete". Try one of the debugging memory allocation packages about, which
should point out the problem.
-- 
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: pandrews@lovat.fmrco.com (Paul Andrews)
Subject: Re: operator [][]
Reply-To: pandrews@lovat.fmrco.com
Organization: Fidelity Investments Ltd.
Date: Mon, 9 Nov 1992 09:53:52 GMT

In article 2Kt@cs.columbia.edu, duanyang@cs.columbia.edu (Duanyang Guo) writes:
> for multiple dimension array, is it possible to define 
> an operator [][](say for two dimensions)? I try to define 
> it as 
> int & operator[][] (int, int);
> 
> which g++ complains about it. 
> 
> any idea or just sth is wrong with my try? 
> 
You can only overload single []. Remember though that this generates a function call
like:
	<class>.operator[](<arg>)

which returns a value. So make that value be a reference to another class which also
has an operator[] overload. Then when you specify:

	<classA>[<arg1>][<arg2>]

you will actually get

	<classA>.operator[](<arg1>).<classB>.operator[](<arg2>)

classB should now call a well-known function in classA to indicate what argument was
passed to it. A good way of doing this is for classA to inherit yet another class
(classC!) which has a well-known virtual function which classA overrides. That way
both classC and classB can be re-used whenever you want to have multiple [].

Simple huh?

(apologies if the syntax of the expanded function calls isn't quite correct).

(I would be interested to know if anyone has any other ways of doing this).

(Is there any standard nomenclature for classes like C and B above? something like
classB is a slave class, classC is a functor or what?)

---
---
Paul Andrews
From: ameesh@lsil.com (Ameesh Desai)
Newsgroups: comp.lang.c++
Subject: Re: template question
Date: 10 Nov 92 21:26:45 GMT
Reply-To: ameesh@lsil.com
Organization: LSI Logic Corporation

In article 22811@aber.ac.uk, brw@aber.ac.uk (Benjamin Roy Whittle) writes:
>
>    If I write the following
>
>template<class T>
>class stack { /* public interface stuff push pop etc*/};
>
>but I want to say that the class T should have a function copy available
>for objects of that class, so that the function can be used in the
>implementation of the stack.
>
>How do I do it please?
>
>email appreciated.
>
>ben
>
>brw@aber.ac.uk


You can't see ARM Page 343 ... "Specifying no restrictions on what types can match
a type argument gives the programmer the maximum flexibility. The cost is that errors
... will not in general detected until link time...."

Hopefully the linker generates an appropriate error message.

Ameesh
---
______________________________     o__            
| _   /|     Ameesh Desai     \    ,>/_                              
| \`O.o'     LSI Logic Corp.   \__(_)`(_)_              email: ameesh@lsil.com
| =(_|_)=    MS E192, 1501 McCarthy Blvd. \             fax  : (408) 433-6802
|____U_______Milpitas, CA 95035____________\____________voice: (408) 433-4097 
Newsgroups: comp.lang.c++
From: cliver@shearson.com (Carl Livermore)
Subject: C++ programming course?
Keywords: C++
Reply-To: cliver@shearson.com
Organization: Lehman Brothers, Inc.
Distribution: usa
Date: Thu, 12 Nov 1992 23:41:10 GMT

Can anybody recommend a good, professional C++
training course? Preferably, but not
necessarily,in New York City.

Thanks

---
Carl J. Livermore		e-mail: cliver@shearson.com
Lehman Brothers			phone: (212) 464-3956

Newsgroups: comp.lang.c++
From: scdorcy@lims01.lerc.nasa.gov (JAMES DORCEY)
Subject: Re: Borland's OWL -- How can I find it?
News-Software: VAX/VMS VNEWS 1.41    
Organization: NASA Lewis Research Center
Date: 13 Nov 1992 15:28 EST  

In article <BxMBD7.DLF@willamette.edu>, bbrown@willamette.edu (Brian Brown) 
writes...
>Where can one find Borland's Object Windows Library?  I thought it came
>with Borland C++ 3.0 compiler, but I found a copy of it, and no OWL. 
>Everything else is there, as far as I can tell.

If memory serves me correctly, the Object Windows Library is part of the 
Applications Frameworks (with the other part being Turbo Vision for DOS), 
which is included in one of the two optional purchase options for Borland 
C++ (as in with and without Applications Frameworks).  If you don't have it, 
you probably purchased Borland C++ 3.0 w/o the Applications Frameworks.  
Both Object Windows and Turbo Vision can be purchased from Borland, and 
_might_ be available at your favorite retail outlet as separate purchase 
items.

>Is there a copy of the OWL at an FTP site somewhere?

Doubtful.

>Please help!  I don't want to attempt Windows(tm) programming without it!

You might also want to consider a possible upgrade from Borland C++ 3.0 to 
Borland C++ 3.1 w/AF.

JD
Newsgroups: comp.lang.c++
From: robert@slipknot.rain.com (Robert Reed)
Subject: Re: Criticisms Wanted
Reply-To: robert@slipknot.rain.com.UUCP (Robert Reed)
Organization: Home Animation Ltd.
Date: Sat, 7 Nov 1992 23:35:57 GMT

One criticism I've heard is that the time saved in debugging due to the strong
typing is consumed in optimizing.

Also, I've seen complaints that tenet of information hiding and code reuse is a
myth with C++ because in order to understand a class you intend to reuse, you
must study the source code anyway.

Now, presumably adequate documentation could ameliorate this problem, but it's
certainly not one specific to C++.  I shudder to think about the hours I spent
tracing though smalltalk methods in order to understand their classes.
________________________________________________________________________________
Robert Reed			Home Animation Ltd.		503-656-8414
robert@slipknot.rain.com	5686 First Court, West Linn, OR 97068

I bought some powdered water but I didn't know what to add
--Steve Wright
________________________________________________________________________________
Organization: Penn State University
Date: Fri, 13 Nov 1992 15:00:02 EST
From: <RDT109@psuvm.psu.edu>
Newsgroups: comp.lang.c++
Subject: Microsoft C/C++ 7

Before buying Microsoft's C/C++ for your home computer, make sure you have a
minimum of 4 ram...
Newsgroups: comp.lang.c++
From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
Subject: Re: Const Inheritance
Organization: MAXTAL P/L C/- University Computing Centre, Sydney
Date: Sun, 8 Nov 1992 03:04:06 GMT

In article <Bx970t.B72@cdsmn.mn.org> wells@cdsmn.mn.org (Rich Wells) writes:
>Duane Voth (duanev@devnull.mpd.tandem.com) wrote:
>: frank@Cookie.secapl.com (Frank Adams) writes:
>: >The idea comes from one of the standard examples of an inheritance
>: >hierarchy: shapes.  Assume we have a class Shape, with a subclass
>: >Rectangle, and we want to add Square as a class.  It seems logical that
>: >Square should be a subclass of Rectangle.
>
>Let us not confuse "subset" with "subclass".  "Subclass" is a concept
>we use for implementation; it need not correspond directly to the
>"subset" and "superset" concepts we may be modeling.

	Not my way of seeing it. Subclasses must be subsets, but that
is not enough, mutators on elements of a subclass must yield valid
member of the subclass, i.e. subclasses are subsets closed under
mutation.

>
>So: although the set of squares is a subset of the set of rectangles,
>it does not (necessarily) mean that the class "square" should be a
>subset of class "rectangle".  Inheritance can be used for both
>genericity AND specialization.  In this case, perhaps Square may be
>the immediate subclass of Shape, with Rectangle a more generic
>subclass of Square containing an extra field for the extra degree
>of freedom.

	In other words, inheritance can be used for other than subclassing.
In particular, inheritance can also be used for composition in a manner
functionally equivalent to inclusion. This is always the case in toto
if the base has no virtual functions, the base could always have
just been included as a member, although you would have to 
export the functions out of it manually.


	In any case, in the C++ community the words 'derived class'
and 'base class' are used where inheritance is concerned, and
'subclassing' should be reserved IMHO for a strict IsA relation.

-- 
;----------------------------------------------------------------------
        JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
	Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
From: vincent@datmuc.UUCP (vincent)
Newsgroups: comp.lang.c++
Subject: Re: Criticisms wanted
Date: 6 Nov 92 17:06:28 GMT
Followup-To: poster
Organization: DAT

Je suit cent pour cent d'accord avec toi.

Consider that:

main.cpp

void main ()
{
	char	_far	*string = "Hello world!\n$";
	int		offset_of_string = (int) ((long) string & 0x0000ffffL);

	_asm {
		mov ah, 0x09
		mox dx, offset_of_string
		int 21				;go for it dos
	}
}

Hhhaaa life is a beach!

Well  you all have a good weekend now, you hear.

ciao vincent@datmuc.dat.de


Newsgroups: comp.lang.c++
From: rmartin@thor.Rational.COM (Bob Martin)
Subject: Re: Casting to an object of a derived class
Organization: Rational
Date: Sat, 7 Nov 1992 01:27:55 GMT

vander@flab.fujitsu.co.jp (Mike van der Velden) writes:

|I've got:

|    class GenericList {
|    public:
|        void*        next ();
|        //...
|    };


|I'd like to do this:
|    class MyObject : public GenericList {
|    public:
|        int  i;
|    };

|    MyObject obj;

|Then I'd like to be able to refer to obj.next().i.  Unfortunately, the
|next() returns a reference to an object of type void (or GenericList,
|if I want), and of course i is not a member of that class.  I need
|next() to return a reference of type MyObject in this case (and other
|objects in other cases).

This is one of the difficulties with contravariant return types.  It
would sometimes be very nice if a member function could return a
pointer or reference to the most derived object, rather than to the
base.  However, the language does not support this feature.

It will, soon, support covariant return types, but these will require
that each derived class repeat the function declaration with the new
return type.

So, in general, there is no way to achieve all your goals.  You are
most likely going to have to put extra member function in each
derivateive of GenericList, which casts the output of next to the
derived type.

However, I would like to make another kind of observation.  The
practice of inheriting the "ability to be put on a list" has the
weakness that it precludes your objects from being on more than one
list at a time.  Since each object has only one link, it can be in
only one linked list at a time.  But this is not enforced by your
class, so if you try to put the object on more than one list at the
same time, you will wind up corrupting lists in odd ways.

A better approach is to use "carriers" in the linked list.  A carrier
is an object of the form:

  class Carrier
  {
    public:
      Carrier* link;
      void* object;
  };

When you add an element to a linked list, the list creates a new
carrier, links the carrier into the list, and points the 'object'
pointer to the object you are adding to the list.

If you combine this technique with templates, you end up with a very
powerful, general purpose linked list class.

--
Robert Martin                        Training courses offered in:
R. C. M. Consulting                       Object Oriented Analysis
2080 Cranbrook Rd.                        Object Oriented Design
Green Oaks, Il 60048 (708) 918-1004       C++
Newsgroups: comp.lang.c++
From: gkrishna@alt.uucp (Gopal-Krishnan)
Subject: Re: RPCGEN/C++
Keywords: rpcgen C++
Organization: Unisys Corp, Camarillo, CA - 93010.
Date: Sat, 14 Nov 1992 00:00:22 GMT

> William J. Barhydt of NASA writes:
> There is another version of rpcgen called RPCGEN.NEW
> available as part of the TIRPC release .  This is not
> yet available under system V.  Anyway this new version
> supports C++. ...........
> TIRPC is available via anonymous ftp from uunet.uu.net
> in the /networking directory as a compressed tar
> file tirpcsrc.tar.Z.  Requires Sun OS4.1 

 I tried this. This rpcgen.new does have a -C option. This option
generates ANSI-C code. So, the code is compilable by C++ Compilers.
That's about it. Other than that, this rpcgen does nothing related to 
C++. 
Anyway, thanks Bill.

-----------------------------------------------------------------------
Gopal Krishnan          | internet: alt!gkrishna@uunet.UU.net
Unisys Corporation      | voice: 805-389-4446
Open Systems Group      | fax  : 805-389-4420
5155, Camino Ruiz       | If we are not watching the little things, (they
Camarillo, CA - 93012.  |  grow big and ) the big things run us over.
-----------------------------------------------------------------------