HDTenEightyP/NetNews huggingface dataset:
From: smasudmz@simile.engin.umich.edu 
Subject: node graph
Date: Mon, 28 Sep 92 10:31:42 EDT
Organization: University of Michigan Engineering, Ann Arbor
Originator: smasudmz@simile.engin.umich.edu



Hi! I'm new to C++ environment and would appreciate some help in the following:
I`m trying to design a node graph. It`s actually a dataflow graph. The node could either be of type (say) X or Y. So there are 2 classes of nodes X and Y.
The nodes are also connected to one another, using directed interconnection objects of types say A, B or C. The X nodes can be connected to one another using A's. X's can have 0 incoming and any no. of outgoing A's. Y`s can be connected to one another using B's. Y's can have any no. of incoming and any no. of outgoing B's. Y nodes are composed of (using C connections) 0 or more A type nodes. An interconnection object (A,B or C) can only exist if its two end points exist. Each node and each interconnection 


object has a unique identifier (integer). 
So what I'm trying to do is : to have a base class NODE with subclasses NODEX and NODEY,
to have a base class CONNECTION with subclasses CONNA, CONNB, CONNC.
I'm not sure how to relate the subclasses with the connections. Also, how
to keep track of the fact that what node has which connections (outcoming or incoming) linked with it and that what connection has which two nodes on both ends. 
If somebody has any suggestions and the time, please mail your suggestions to
smasudmz@caen.engin.umich.edu
--
sm
Xref: sparky comp.lang.c++:14244 gnu.g++.help:1290
From: pjl@sparc22.cs.uiuc.edu (Paul Lucas)
Newsgroups: comp.lang.c++,gnu.g++.help
Subject: Re: Interaction templates/const member functions
Date: 28 Sep 92 20:01:45 GMT
Distribution: usa
Organization: University of Illinois at Urbana-Champaign

In <35709@hoptoad.uucp> brendan@cygnus.com (Brendan Kehoe) writes:

>In article <1992Sep25.134347.3603@sunb10.cs.uiuc.edu> pjl@sparc10.cs.uiuc.edu (Paul Lucas) writes:

>   In <1992Sep24.213609.25858@CS.ORST.EDU> budd@fog.CS.ORST.EDU (Tim Budd) writes:

>   >Don't know if this is a bug in g++ (version 2.2) but it seems to
>   >disagree with my reading of the ARM.  This has to do with an odd
>   >iteraction between template classes and constant member functions.

>   	   Yes; use AT&T C++ 3.0.  It compilies your code with only a warning
>	   about your c'tor not having a const T& when you pass a 5 to it
>	   since it has to create a temporary.

>This is absolutely not the right solution.  You're first, paying for
>software, and second, paying USL, whose attack on all of the free
>computing world by suing BSDI and the regents of UCB for their
>collective work is decidedly unfriendly.

*****>	I was looking at it from a tool point-of-view; I have no control
	over what USL's lawyers do.  It was meant as "you have a need,
	here's a tool that works right now" not as an all-out endorement
	of USL nor a condemnation of other compilers.

>Rather, wait until GCC 2.3 (early October), where this bug is fixed,
>and continue to enjoy the rights of using free (including full source
>code).

>Rather than pay for software, report clear coherent bugs (for G++,
>write to bug-g++@prep.ai.mit.edu) and we'll do our best to fix them.

*****>	I have no data to argue whose compilers are less buggy...but I
	wish I did.  In some people's opinion, free software is worth
	what you've paid for it.

	Chill out...jeez.
-- 
	- Paul J. Lucas				University of Illinois	
	  AT&T Bell Laboratories		at Urbana-Champaign
	  Naperville, IL			pjl@cs.uiuc.edu
From: pj@sam.wpd.sgi.com (Paul Jackson)
Newsgroups: comp.lang.c++
Subject: How to ensure correct argument type provided.
Keywords: integer promotion argument type checking
Date: 2 Oct 92 03:54:53 GMT
Reply-To: pj@sgi.com
Organization: Silicon Graphics, Research & Development

Question:

I have some routines that pass around a couple of small integer
arguments, amongst other args.  I want to type these args so that
the compiler will warn if args of the wrong type are passed.  How
can I inhibit automatic promotion of other integer types, and get
a warning or error instead.

For example, what type (or other change) could I make (to) i1_t
and i2_t in the following so that the compiler would not silently
accept my passing a type i2_t to a function declared to expect a
type i1_t:

    typedef int i1_t;
    typedef int i2_t;
    
    extern void foo(i1_t);
    
    main(){
        foo(i2_t(1));       // wrong foo arg 1 type; but no warning
        return 0;
    }
    
    void foo(i1_t i){
        foo(i);
    }

Thanks.

-- 

				I won't rest till it's the best ...
				Software Production Engineer
				Paul Jackson (pj@sgi.com), x1373
From: checker@acf5.NYU.EDU (checker)
Newsgroups: comp.lang.c++
Subject: Re: User-defined conversions for pointers?
Date: 3 Oct 92 01:55:53 GMT
Organization: New York University

doug@foxtrot.ccmrc.ucsb.edu (Douglas Scott) writes:
>As I
>understand it, instances of this type of derived class will take up the same
>amount of memory (no more or less) as the base class, because they only differ
>in the number of available methods.

This is totally implementation dependent.  Don't write code that depends
on it.

>	SpecialDerived *s = (SpecialDerived *) b; // cast pointer
>	s->someSpecialDerivedMethod(); // call specialized method
>Is there any reason why this would be dangerous or ill-advised?

If b doesn't point to a SpecialDerived, the behavior is undefined.

>Is it true
>that if the coerced type differs only in "methodology", there will not be any
>possibility of attempting to call a function or access a member in the
>twighlight zone?

You have no guarantees.  The solution is to redesign so that you don't
have to downcast.

>It seems to me that the correct amount of memory would be freed in this case
>as well.

Use a virtual destructor.

>class Base {
>	operator SpecialDerived *();
>};
>would this operator be called in the above example if defined as such?

No, this means that any Base object (or reference) can be converted to a
pointer to a SpecialDerived.  A pointer to a Base is not a Base.

>Are there flaws in my reasoning?

Downcasting (casting from base to derived) is dangerous, makes for hard
to maintain and understand code, and usually points to a flaw in the
original design.  Try and rethink so that you don't have to do it.

Chris
From: brennan@hal.com (Dave Brennan)
Newsgroups: comp.lang.c++
Subject: Re: Callbacks - C++ needs an extension?
Date: 28 Sep 92 20:04:28 GMT
	<1992Sep7.173259.7012@edrc.ac.uk>
Organization: HaL Computer Systems, Austin, TX
NNTP-Posting-Host: yosemite.hal.com
In-reply-to: a_mahmoo@edrc.ac.uk's message of 7 Sep 92 17:32:59 GMT

>>>>> On 7 Sep 92 17:32:59 GMT, a_mahmoo@edrc.ac.uk (Arshad Mahmood) said:

[ Most of C++ code to handle callbacks deleted. ]

> void XCC::theCallback(Widget w, void* client_data, void* call_data)
> {
>   XCCStruct* cb_struct = (XCCStruct *)client_data;
>   XCC* mclass = cb_struct->me;
>   
>   (mclass->*(cb_struct->callback))(w, cb_struct->client_data, call_data);
> }

The Widget Wrapper Library (or WWL) uses the same method to support member
function callbacks.  You have to be careful, though, because it is strictly
not legal to call a member function of a derived class this way if the
member is not inherited from the base class.  (It's OK to overload in the
derived class, though).  For the most part it does work in the C++
implementations I've tried it with.

I did run into one nasty problem with cfront.  If the member function is
virtual and the base class (in this case XCC) has no virtual functions
cfront will (correctly) assume that the code generated for the member
function call above cannot be virtual.  As a result cfront will not generate
code to see if the pointer to member (cb_struct->callback) is a virtual
function, which will probably result in a segv if it is virtual.  (If you're
not familiar with the cfront implementation of pointers to members take my
word for this, or read up on it in ARM 8.1.2c "Implementation of Pointers to
Members," which is on pg. 158 in the 2nd ed.)

The fix is to add a dummy virtual function to the base class (XCC) so that
the right code will be generated.  I did this for WWL.  Of course, the fact
remains that this is still illegal C++ code, but I'll take my chances for
now to avoid writing a static function for every member function.

BTW,

#define AddCallback(w,name,cb,cdata) AddCCCallback(w,name, (Callback)&cb,cdata)
                                                           ^^^^^^^^^^
Don't you just hate this ugly cast because C++ requires name equivalence??
Why can't there be an implicit conversion for expressions of the type
"function returning something??"  This really annoys me.
--
Dave Brennan                                      HaL Computer Systems
brennan@hal.com                                         (512) 794-2855

Visit the Emacs Lisp Archive: archive.cis.ohio-state.edu:pub/gnu/emacs
Newsgroups: comp.lang.c++
From: dshaker@qualix.com (Doug Shaker)
Subject: Re: Plum-Hall test suite
Reply-To: dshaker@qualix.com
Organization: QUALiX Group, Inc.
Date: Thu, 1 Oct 1992 18:57:02 GMT

In article 715@data.rain.com, courtney@data.rain.com (Courtney Meissen) writes:
>I am trying to track down the whereabouts of Plum-Hall, who used
>to make a C language validation suite.  Does anyone have a phone
>number for them (southern NJ someplace).
>
>thank you.

Moved to Hawaii - 808-885-6663. Fax= 808-885-3569
email = plum@plumhall.com


 - Doug Shaker

	voice:	415/572-0200
	fax:	415/572-1300
	email:	dshaker@qualix.com
	mail:	Qualix Group
		1900 S. Norfolk St., #224
		San Mateo, CA 94403


Newsgroups: comp.lang.c++
From: jaswal@mrcnext.cso.uiuc.edu (Vijendra Jaswal)
Subject: Re: NIHCL Doc's
Organization: CSO Resource Center
Distribution: comp
Date: Sat, 3 Oct 1992 17:47:42 GMT

NIHCL is a large C++ class library from the National Institute of Health.

: 	Please, could you say me which is the way to obtain NIHCL for BC++3.1?
: 

I just picked up a copy of nihclbcp.zip via anonymous ftp from the following:
(It's archie output)

Host rs3.hrz.th-darmstadt.de

    Location: /pub/programming/languages/C++/class-libraries/NIHCL
           FILE -rw-rw-r--     418482  Sep 18 09:40  nihclbcp.zip
From: news@fedfil.UUCP (news)
Newsgroups: comp.lang.c++
Subject: Professional C++ compiler/dev-system for Deskview/X
Date: 4 Oct 92 01:47:03 GMT
Organization: HTE


I am coming to regard MS Windows as a least common denominator;  if that's
all you can do with your computer, that's not BAD.  However, I've now seen the
software environment which I've actually wanted for 386 and 486 computers,
and it's called Deskview/X.  I'd be interested in hearing from Borland or
Zortech or anybody who plans to market a good 32-bit compiler for Deskview/X
which would include online help similar to Borland's for C/C++, Xlib, XT,
Athena widgets, the Berkeley socket system and anything else required for
DVX.


-- 
Ted Holden
HTE

Newsgroups: comp.lang.c++
From: etxjlar@eua.ericsson.se (Jorgen Larsson)
Subject: Re: Segmentation fault
Reply-To: etxjlar@eua.ericsson.se
Organization: Ellemtel Telecom Systems Labs, Stockholm, Sweden
Date: Mon, 5 Oct 1992 13:35:12 GMT


In article 16093@nntp.hut.fi, s36474r@kaira.hut.fi (Mikko Malinen) writes:
> I compiled a C++ program with g++ compiler in IBM 6000.
> Could anybody tell me why the runtime error "segmentation fault"
> occurred? The compiler did not give any error messages.
> 


It's quite hard to tell since there are some hundreds of possibilities. 
Don't expect the compiler to cover run-time errors.

  /Jrgen Larsson
From: raymond@es.ele.tue.nl (Raymond Nijssen)
Newsgroups: comp.lang.c++
Subject: The concept of templates considered ill designed
Date: 28 Sep 92 13:50:10 GMT
Distribution: comp
Organization: Eindhoven University of Technology, Eindhoven, The Netherlands

Given:

  ---- ape.h --------------------------------------------------------
  template <class T> class ape
  {
  public:
            ape();
  };


  ---- ape.cc -------------------------------------------------------
  #include "ape.h"
  
  template<class T> ape<T>::ape () {};


  ---- main.cc ------------------------------------------------------
  #include "ape.h"

  #ifdef unnecessary
  #include "ape.cc"
  #endif

  int main()
  {
     ape<int> chimp;
  }
  -------------------------------------------------------------------


Now, if the _definition_ of the constructor of the ape class isn't textually
included in the file in which the template is instantiated, the linker will
complain that there's no code for this constructor in ape.o.

And, indeed:

  % nm ape.o
  
  Symbols from ape.o:
  
  Name                    Value   Scope  Type    Subspace
  
  LS$START_001_000$   |         0|static|data   |$CODE$
  LS$START_002_000$   |1073741824|static|data   |$DATA$
  LS$START_001_001$   |         0|static|data   |$LIT$

That's all ... no code was generated for the ctor!


This, and other observations lead to the conclusion that templates are to be
regarded as almost old-fashioned macros, in contrast to what the ARM made me
believe (or should I say `hope'?).

Accordingly, the only way to make this work is to #include all files
containing _definitions_ (so just the _declarations_ is not enough, as the ARM
implicitly suggests) in files in which those templates are used.

If this is true, then I'm afraid the design of the concept of templates has
some heavy repercussions for any programmer using it: you'll have to #include
almost all *.h and *.cc files into most .cc files, which is little different
from putting all your code into one big file, particularly wrt. compiling it.

Bjarne, are you listening? Or can somebody else explain:

  1) Should the programmer regard templates as old-fashioned macros?
  2) How are templates dealt with by the compiler?
  3) How does this affect coding style?

Or... is gcc 2.2.2 flaky wrt. templates?

aTdhvaannkcse !
-Raymond
--
| Raymond Nijssen         | Eindhoven University of Techology                 |
|                         | Department of Electrical Engineering              |
| raymond@es.ele.tue.nl   | Design Automation Section (ES),  Room EH 7.16     |
| phone: +31-40-473373    | P.O. Box 513, 5600 MB Eindhoven, The Netherlands  |
| fax:   +31-40-464527    |  "Jan Timmer for President of The Netherlands!"   |
Newsgroups: comp.lang.c++
From: dshaker@qualix.com (Doug Shaker)
Subject: Looking for Cellular Automata in C++
Reply-To: dshaker@qualix.com
Organization: QUALiX Group, Inc.
Date: Mon, 5 Oct 1992 16:14:22 GMT

I am looking for C++ code (free or otherwise) that implements
some basic cellular automata.  Any pointers?

 - Doug Shaker

	voice:	415/572-0200
	fax:	415/572-1300
	email:	dshaker@qualix.com
	mail:	Qualix Group
		1900 S. Norfolk St., #224
		San Mateo, CA 94403
From: ameesh@lsil.com (Ameesh Desai)
Newsgroups: comp.lang.c++
Subject: Re: yacc in c++?
Date: 1 Oct 92 20:35:12 GMT
Reply-To: ameesh@lsil.com
Organization: LSI Logic Corporation

In article 29150@news.th-darmstadt.de, schrod@iti.informatik.th-darmstadt.de (Joachim Schrod) writes:
>In article <CARNEY.92Sep29085216@rocky.rational>, carney@rocky.rational (Mike Carney) writes:
>> 
>> In article <1992Sep29.011845.3409@sunb10.cs.uiuc.edu> pjl@sparc10.cs.uiuc.edu (Paul Lucas) writes:
>>    In <BvB5oD.4FD@cs.columbia.edu> igor@cs.columbia.edu (Igor Pankevich) writes:
>> 
>>    >I am a student (forgive me if this is a FAQ, I couldn't find the
>>    >answer at my site.)  I need to write a yacc grammar that will work
>>    >with my c++ program.  Where can I find a version of yacc to do this?
>> 
>>    *****>	Standard yacc works with C++; you just have to write your own
>> 	   .y.c (or .y.o) rule to replace the "extern char *malloc()" line
>> 	   with "#include <stdlib.h>"
>> 
>> Not it the version of yacc that I have (SunOS 4.1.2). The output from
>> this is K&R C, which will not compile with a C++ compiler. Therefore,
>> I cannot have (with my version of yacc) C++ actions in my grammar. In
>> fact, I've only seen third party products, and a special version of
>> yacc from Sun called yacc++, which work properly with C++ code.
>
>Then use bison. Available from all sites which keep GNU software. I've
>used its output with C++ without changes. (Actually, without changes
>during the usage. At installation time I added a prototype for
>alloca() to the parser skeleton. ;-)
>
>Or use bison++. It outputs the parser as a C++ class which can be
>instantiated.
>
>bison++ is available via anonymous ftp
>    in the US:
>	wilbur.stanford.edu
>	directory /pub
>
>    in Europe:
>	ftp.th-darmstadt.de [130.83.55.75]
>	directory /pub/programming/languages/C++/tools
>
>--
>Joachim
>
>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>Joachim Schrod			Email: schrod@iti.informatik.th-darmstadt.de
>Computer Science Department
>Technical University of Darmstadt, Germany


If you intend to use bison to create a production software, you might run into
the FSF Copyleft - beware.

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 
Xref: sparky comp.lang.c++:14339 comp.std.c++:1252
From: linton@marktwain.rad.sgi.com (Mark Linton)
Newsgroups: comp.lang.c++,comp.std.c++
Subject: Re: Conceptual Constness
Date: 30 Sep 1992 16:29:55 GMT
Organization: sgi
Distribution: world
Reply-To: linton@marktwain.rad.sgi.com (Mark Linton)
NNTP-Posting-Host: marktwain.rad.sgi.com
Keywords: const, const member, lazy

This subject has been visited in the past.  There have been several language
proposals, though I don't know if any are being taken seriously.

Several people missed the basic issue, which is that you have a member function
that you want to be able to pass a const object (such as a const parameter)
but the implementation of the function wants to modify member data.
This happens commonly for cached or lazily-evaluated data, where modifying
the data doesn't change the future behavior of the object.  The example I typically use
for this is a matrix object that has an identity() test.  It is easy to imagine that

    We want to call identity() on a const matrix.
    We don't want to compute the identity test until necessary.
    We don't want to compute the identity test more than once for the same matrix.
    We can use access functions to detect changes to the matrix.
    We don't want a pointer to an extra structure for the matrix representation
        because we want to create matrices on the stack quickly.

Perhaps most importantly, we shouldn't have to change the specification
of identity() if we decide to change the implementation (switching between
non-caching and caching or lazy and non-lazy, for example).

Splitting the class into two classes, one read-only and one read-write doesn't help
because we really want to call the member function in question on an immutable object
(the storage changes, but the behavior other than performance does not).

Using a #define conceptual_const doesn't work either.  Again, the problem
is that I have a parameter that I want to declare const and then call the
member function on.  If the function isn't really declared const, then
the compiler will complain if I try to call it on a const object.

There are only two solutions as the language currently stands.  One is
to cast "this" to a non-const object in the member function.  I agree with
the original poster that this is ugly, but I suspect others find it
acceptable enough to classify the whole problem as low priority.

The other solution is not to use const at all.  The downside of this approach
is that without const you cannot really use ref parameters without risking
warning messages when you construct temporaries for arguments
(some compilers are unhappy when you pass a temporary to a non-const ref).
Without refs it becomes a bit more painful to use objects with natural definitions
for operations, such as comparisons on strings.
Newsgroups: comp.lang.c++
From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
Subject: Re: declare keyword, type inference
Organization: Computer Science, University of Melbourne, Australia
Date: Mon, 5 Oct 1992 02:04:16 GMT

ark@alice.att.com (Andrew Koenig) writes:

>In article <TMB.92Oct4201915@arolla.idiap.ch> tmb@idiap.ch writes:
>
>> 	template <class T> typedef Array<Array<T> > Foo;
>
>Does this buy anything over
>
>	template <class T> class Foo: public Array<Array<T> > { }

Yes. The poorly named "typedef" creates a type alias, whereas
public derivation creates a distinct new class.

Apart from the difficulties of mixing Foo<t> and Array<Array<t> >,
the typedef actually saves global data space, since the public derivation
approach requires the compiler to emit a vtable for each of the Foo<t> classes.

-- 
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!
From: harrison@sunwhere.dab.ge.com (Gregory Harrison)
Newsgroups: comp.lang.c++
Subject: Re: System crash while compiling
Date: 3 Oct 92 22:42:33 GMT
Organization: General Electric SCSD, Daytona Beach FL

In article <XX41TB12w165w@csource.oz.au> david@csource.oz.au writes:
>Chris Chew <CCHEW@UCF1VM.BITNET> writes:
>
>> Hi all,
>>          I don't know if this is a common question, but I have a system
>> that keeps crashing when I compile in Borland C++ 3.0/3.1  It only
>> happens when I compile, usually when the machine is slightly warm,

BC++ V2.0 used to crash on me during compiling when I moved the mouse.  
Borland then said not to move the mouse while compiling.  They suggested 
getting a newer mouse driver, hah, they didn't get much newer than the 
three or four different ones I tried.  I currently use BC++ (and MSC++,
and thinking about Metaware for 32-bitness) but haven't noticed the 
problem yet (just upgraded).

Why?  Are mouse drivers buggy?  Do they corrupt context, wrench caches,
pestilize parameters? 

Try not moving the mouse

Greg Harrison
Lead SW Eng, GE
  

a
From: brendan@cygnus.com (Brendan Kehoe)
Newsgroups: comp.lang.c++
Subject: Re: C++ to C converter
Date: 2 Oct 92 21:31:37 GMT
	<1992Oct1.144531.518@cine88.cineca.it>
Reply-To: brendan@cygnus.com
Organization: Cygnus Support, Palo Alto CA; Phone +1 415 322 3811
In-reply-to: marcello@deis20.cineca.it's message of 1 Oct 92 14:45:31 +0100

In article <1992Oct1.144531.518@cine88.cineca.it> marcello@deis20.cineca.it (Marcello Dalpasso) writes:

   Can you use g++ to translate C++ code to readable C code?

No, you can't. It's a native compiler, in that it compiles your C++
code directly.  It doesn't go the route of first converting everything
into C.

Brendan
--
Brendan Kehoe                                               brendan@cygnus.com
Cygnus Support, Palo Alto, CA                                  +1 415 322 3811
                                                 Re-elect Clinton/Gore in '96!
Newsgroups: comp.lang.c++