HDTenEightyP/NetNews huggingface dataset:
From: mckang@solomon.technet.sg (Kang Meng Chow)
Subject: Turbo Vision + Phar Lap 286 DOS Extender
X-Newsreader: TIN [version 1.1 PL8]
Date: Tue, 26 Jan 1993 05:52:25 GMT




Hi,
	Has anybody tried using Turbo Vision for C++ with PharLap's 286
DOS Extender? I've previously tried with the Lite286 that came with BC
++ 3.1 but couldn't get the program running (compilation okay).

	Specifically, I would appreciate it if anyone can tell me what
changes need to be made to Turbo Vision as well as what care must be
taken in my own application in order to develop a TV program that makes
use of all the memory available (thru' PharLap's DOS Extender).

	Thank you and best regards.


Kang, Meng Chow


Xref: sparky comp.lang.c++:20056 comp.std.c++:2139
From: RKOHLBUS@jennifer.umd.edu (Robert C. Kohlbus)
Newsgroups: comp.lang.c++
Subject: FAQ
Date: 22 Jan 93 20:58:06 GMT
Organization: University of Maryland


	I'm looking for an FAQ to this news group if one exists.  I'm also
looking for an excellent FTP Sites with good C++ code,programs,etc.  Any
information that you can provide would be very helpful.  Thank You.

=========================================================================

Robert Kohlbus
University of Maryland
Network Admin. / Computer Programmer
Internet:
    rkohlbus@jennifer.umd.edu
    kohlbus@wam.umd.edu

=========================================================================
From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
Newsgroups: comp.lang.c++
Subject: Re: operator = with inheritance
Date: 26 Jan 93 21:14:56 GMT
Organization: MAXTAL P/L C/- University Computing Centre, Sydney

In article <1993Jan21.162116.24219@murdoch.acc.Virginia.EDU> gs4t@virginia.edu (Gnanasekaran Swaminathan) writes:
>maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
>: 	It wont cope with class C: public A though:
>: this will still slice the A part of a C object onto the A part
>: of a B object. What else COULD it do?
>
>	A
>       / \
>      B   C
>
>Since, B and C has only A part common, that is
>the appropriate thing to do, isn't it?

	Well, who knows? But the technique makes assignments

	A->A

special (they assign the complete object) but other not special,
which may, or may not, be a good thing. That is, it 'solves'
the slicing problem for a special (but very important) case.

The generalisation does the 'best possible' assignment it can
(e.g. in the case A derives B derives C derives D derives E ...
then it 'reduces' the slicing to the minimum possible,
although not preventing it.

-- 
;----------------------------------------------------------------------
        JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
	Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
;------ SCIENTIFIC AND ENGINEERING SOFTWARE ---ph:  2 799 8223 --------
Newsgroups: comp.lang.c++
From: nikki@trmphrst.demon.co.uk (Nikki Locke)
Subject: Re: operator = with inheritance
Reply-To: nikki@trmphrst.demon.co.uk
Distribution: world
X-Mailer: cppnews $Revision: 1.31 $
Organization: Trumphurst Ltd.
Date: Fri, 22 Jan 1993 15:13:40 +0000

In article <1993Jan20.221834.26489@murdoch.acc.Virginia.EDU> gs4t@virginia.edu (Gnanasekaran Swaminathan) writes:
> nikki@trmphrst.demon.co.uk (Nikki Locke) writes:
> : But this unfortunately fails the test from the previous posting ...
> 
> It works fine. Note the assign op is also virtual.
> 
> Since assign op is virtual, B::op = (a2) is called for
> reference a1. B::op = (a2), in turn, calls B::copy2 (this).
> 
> g++ compiler gets this wrong. Probably try a different compiler
> if you are using g++.
I am afraid I think it is YOU who has got it wrong !

I tested the program at the end of this post under Zortech c++ 3.0r4,
Borland C++ 3.0, and Microsoft C7, and they all gave the following output ...

B::=(A&)
B::copy2(A*)
A::copy2(A*)
b1.b = 11 b2.b = 22 b1.a = 2 b2.a = 2

If you follow this through,
a1=a2; calls the virtual operator B::operator=(const A&)
B::operator=(const A&) calls virtual function B::copy2(A*), NOT B::copy2(B*),
  because polymorphism doesn't act on function arguments.

Did you actually test this on some compiler ? If so, which one ?
_I_ think it has a bug !
-- 
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.
----------------------- cut here -------------------------
#include <iostream.h>

class A {
public:
  int a;
  virtual void copy2 (A* c) const { c->a = a; cout << "A::copy2(A*)\n"; }
  A (int c): a(c) {}
  virtual A& operator = (const A& c) {
      if (this != &c) { // testing for assignment to the same object
        cout << "A::=(A&)\n"; 
	c.copy2 (this);
      }
      return *this;
  }
};

class B: public A {
public:
  int b;
  virtual void copy2 (A* c) const { cout << "B::copy2(A*)\n"; A::copy2 (c); }
  virtual void copy2 (B* c) const { cout << "B::copy2(B*)\n"; A::copy2 (c); c->b = b; }
  B (int c): A(c), b(2*c) {}
  A& operator = (const A& c) {
     if (this != &c) {
       cout << "B::=(A&)\n";
       c.copy2 (this);
     }
     return *this;
  }
};

main()
{
	B b1(1);
	B b2(2);

	b1.a=1;
	b1.b=11;
	b2.a=2;
	b2.b=22;
	
	A &a1=b1;
	A &a2=b2;

	a1=a2; // OH! only assigns the 'A' subobject of B.
             // A::op= (a), A::copy2 (A* &a)
	cout << "b1.b = " << b1.b << " b2.b = " << b2.b << " b1.a = " << b1.a <<
		" b2.a = " << b2.a << "\n";
    return 0;
}
From: bobs@hal.gnu.ai.mit.edu (Bob Sutton)
Newsgroups: comp.lang.c++
Subject: C++ problem
Date: 28 Jan 93 08:53:55 GMT
Organization: /etc/organization
NNTP-Posting-Host: hal.ai.mit.edu

I could use a bit of help with a C++ program I've been working on.  This 
problem has been crashing my PC.  I have traced it to one line of code.
However, I'm puzzled as to the reason why this line is bad.

Given the following declaration:

	Window **WindowList;

where 'Window' is a C++ class, shouldn't 

	WindowList=(new Window **) [n];

allocate off the heap an array of n (Window *) pointers? Apparently, 
Turbo C++ isn't doing this. 

Any help would be appreciated via email.

-- 
Bob Sutton                        Love, most bitterly and fiercely oppresses
bobs@gnu.ai.mit.edu		  those who fight it than those who offer
al876@cleveland.freenet.edu       their servitude.    -- Ovid, "Amores". 
rsutton@eis.calstate.edu
From: sp_ppm@space.alcbel.be (Paul Moore)
Newsgroups: comp.lang.c++
Subject: Wanted: C++ Classes
Date: 26 Jan 93 17:05:49 GMT
Reply-To: sp_ppm@space.alcbel.be
Organization: Alcatel Bell Telephone

Hello,

I'm looking for freely available C++ classes, mainly to improve me knowledge of the language. I remember reading somewhere about sites that have these available, but 
I've forgotten where they are.

Can anyone help me by letting me know where I can locate some?

Thanks in advance, Paul

---
Paul Moore,                      email: sp_ppm@space.alcbel.be
ALcatel Bell Telephone,
Berkenrodelei 33,                phone: (+32) 3/829.5024
2660 Hoboken,
Belgium.

Newsgroups: comp.lang.c++
From: an5802@anon.penet.fi (The Inquisitive One)
Subject: Comparison of OODBs
Organization: Anonymous contact service
X-Anonymously-To: comp.lang.c++
Date: Sat, 23 Jan 1993 06:20:52 GMT


Does anyone know of any work on comparison of two or more OODBs for effiency, speed, etc ? Any sources would be welcome.
I do know of the existence of the OO1 benchmark developed at Wisconsin in March 1992.

Thanks 

P.S. Has there been any comparative study of the various OODBs in the market, in general, in terms of implementation and other features available to the programmer ?

-------------------------------------------------------------------------
To find out more about the anon service, send mail to help@anon.penet.fi.
Due to the double-blind system, any replies to this message will be anonymized,
and an anonymous id will be allocated automatically. You have been warned.
Newsgroups: comp.lang.c++,gnu.g++.help
From: mal@world.std.com (Mark A Lamourine)
Subject: C++ Reference Examples Online
Keywords: c++ evaluation validation examples
Organization: The World Public Access UNIX, Brookline, MA
Date: Thu, 21 Jan 1993 23:02:52 GMT

Hi,

I've been given the task of evaluating a number of C++ compilers.  Among other
things, I want to try to verify compliance with the ARM (ATT 2.1).  I don't
have a spec for the 3.0 extensions, but any tests would be nice.  I am 
aware of the Perennial (sp?) test suite. ($$$)

I have copies of InterViews and nihcl sources (3.1 and 3.0 respectively).
Of course, these may not comply with the spec, but sure must be close...

I was wondering if anyone had coded the examples in the most popular
references (ARM, Stroustrup 2nd Ed., or Lippman 2nd Ed.)  I'm considering 
doing it myself, but if it's already been done...

Any other suggestions?

Thanks, 

- Mark
Newsgroups: comp.lang.c++
From: pete@borland.com (Pete Becker)
Subject: Re: Calling of a parent method
Originator: pete@genghis.borland.com
Organization: Borland International
Date: Thu, 21 Jan 1993 22:40:01 GMT

In article <1993Jan20.153647.25160@neptune.inf.ethz.ch> mhof@iiic.ethz.ch (Markus Alexander Hof) writes:
>
>My question now: Is therea way to specify a call to a method of your immediate parent,
>without naming him, so that is is possible to insert an intermeddiate class without
>having to cchange the son

	Sure is.  Not quite as convenient as having a keyword:

	class D : public B
	{
	typedef B Parent;
	void f();
	};

	void D::f()
	{
	Parent::f();
	}

	If you change the name of the base class you have to change the
typedef, but nothing else has to be changed.
	-- Pete
From: vivier@sol.crd.ge.com (Barbara Vivier)
Newsgroups: comp.lang.c++
Subject: Energize
Date: 25 Jan 93 15:39:12 GMT
Organization: GE Research & Development


	If anyone who has had direct experience with Lucid's Energize
	is willing to share their experience, I would appreciate hearing.

	Net access is difficult, so email to vivier@geis.geis.com would
	be preferred (perhaps also posting to the net for everyone's
	benefit)

	Thanks in advance,

		- Barbara
Newsgroups: comp.lang.c++
From: mat@mole-end.matawan.nj.us
Subject: Re: Type-cast to void
Summary: function-style cast is `value builder' is necessary!
Organization: :
Date: Mon, 25 Jan 1993 01:20:51 GMT

In article <898@ulogic.UUCP>, hartman@ulogic.UUCP (Richard M. Hartman) writes:
> In article <dak.727311054@hathi> dak@hathi.informatik.rwth-aachen.de (David Kastrup) writes:
> >grimmer@nyx.cs.du.edu (Geoff Rimmer) writes:

> >In my opinion, function
> >style casts were a mistake from the beginning. They ambiguate code,
> >gain nothing, and typedefs, constructors and functions form an amorph
> >mishmash.
 
> I do not know if this is a legitimate statement
> 	x = (X) i;
> which *would* have been the way to write a cast if we did not
> use the constructors instead.  ...

Yes, it is.  The symmetry, while not perfect, is strong.

> use the constructors instead.  The functional syntax of casting:
> 	i = int(x);
> is merely for symmetry with the class constructors.  I think that
> a constructor is NOT a cast, and this is a false symmetry.  And
> that the idea of functional style of casting should have been 
> strangled in the cradle!

There's another important use, the `constructor-as-expression,' for
which someone long ago coined the unofficial term `value builder':

	const Point origin( 0.0, 0.0 );
	Rectangle working_extent = exent.intersection(
					Rectangle( origin, z.ne() ) );

This looks clumsy, but try to write the equivalent code otherwise!
-- 
 (This man's opinions are his own.)
 From mole-end				Mark Terribile

 mat@mole-end.matawan.nj.us, Somewhere in Matawan, NJ
Newsgroups: comp.lang.c++
From: aruba!mikea@uu2.psi.com (Mike Arsenault)
Subject: Templates with int arguments ???
Date: Thu, 28 Jan 1993 18:30:21 GMT
Organization: Project Zed

I'm trying to use templates with 'int' arguments as opposed to 'class'
arguments. Here's the code.

//////////// start here ///////////////////////////////////
template <int sz>
struct structTemplate {
int i;
char ch[sz];
};


template <int size> 
class classTemplate {
	int i;
	char * p;
public:
	void method(const structTemplate<size> & stru);
};

template <int size> 
void classTemplate<size>::method(const structTemplate<size> & stru) {  // line 18
}

main () {
	classTemplate<10> aClass;
	structTemplate<10> aStruct;

	aClass.method(aStruct);
}
//////////// end here ///////////////////////////////////

and the errors I get from a simple compile such
as 'CC -o template template.cc' (HP-UX C++ compiler v. 3.0) are:

CC: "template.cc", line 18: error: template argument mismatch: expected  const int  f
or formal  sz, not  class classTemplate <L210 >  (1797)
"template.cc", line 18:          error detected during the instantiation of classTemplate<L210 >

 "template.cc", line 27:         is the site of the instantiation
  CC: sorry, cannot recover from previous errors


I thought there might be a problem with the multiple templates, so I
substituted the keyword 'int' with 'class', took out the char array
in structTemplate and instantiated the two templates in main with
some class (String). This compiled ok.

The above code was tried with Borland C++ 3.0 with no problems.
Is this a bug with the HP compiler or is it something the sneaks
by the Borland Compiler?

Thanks in advance....
-- 
*******************************************************************************
* Mike Arsenault                |Internet Style: aruba!mikea@uu2.psi.com      *
* Systems Programming           |UUCP     : ...!uunet!uu2.psi.com!aruba!mikea *
*******************************************************************************
From: nikki@trmphrst.demon.co.uk (Nikki Locke)
Newsgroups: comp.lang.c++
Subject: Re: Is this C++ advice from an OO book true? (beginner question)
Date: 27 Jan 93 11:38:30 GMT
Reply-To: nikki@trmphrst.demon.co.uk
Organization: Trumphurst Ltd.
X-Mailer: cppnews $Revision: 1.31 $

In article <BAB.93Jan24100815@se39.wg2.waii.com> bab@se39.wg2.waii.com (Brian Button) writes:
> I don' think the question was why to call a virtual constructor for a
> base class, but why to call a constructor for a virtual base class.
> 
> These constructors need to be called to ensure that the data members
> of any parent classes are properly initialized. For instance:
> 
> class VirtBase
> {
>   private:
>     int     a;
> 
>   protected:
>     int     myA( ) const            { return a; }
>     int     myA( const int anA )    { return a = anA; }
> 
>   public:
>     VirtBase( const int anA ) : a( anA ) { }
> };
> 
> class DerivedClass : virtual public VirtBase
> {
>   public:
>     DerivedClass( const int anA ) : VirtBase( anA ) { }
> };
> 
> If VirtBase weren't initialized in the constructor for DerivedClass,
> VirtBase::a would never be initialized. This is one reason why you
> should always explicitly call the constructor for any base classes in
> a derived classes constructor.

In your example, if "VirtBase weren't initialized in the constructor for
DerivedClass", then the program would not compile, as VirtBase does not 
have a default constructor.

-- 
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: hansen@pegasus.att.com (Tony L. Hansen)
Subject: Re: Is (p) instead of (p!=NULL) portable? 
Organization: AT&T
Date: Tue, 26 Jan 1993 02:21:27 GMT
Summary: yes
Keywords: null pointers, C, C++

< From: robert@alkymi.unit.no (Robert Schmidt)
< In PC C's, the NULL pointer is defined with a bit pattern of all zero's,
< and the constructs
<      if (p)
<and
<      if (!p)
< checks for NULL and non-NULL respectively.  Is this portable to *all*
< platforms?

The bit pattern used for null pointers is irrelevant to the question. By
definition,

	if (p)

is exactly equivalent to

	if (p != 0)

For all pointer comparisons against 0, the constant 0 is converted by the
compiler to the appropriate bit pattern for the null pointer for that
machine, and then the comparison is done.

So, the answer to your question is "yes, it is portable to all platforms".

					Tony Hansen
			    hansen@pegasus.att.com, tony@attmail.com
				att!pegasus!hansen, attmail!tony
Newsgroups: comp.lang.c++
From: brett@brett.mentorg.com (Brett Stutz @ PCB x5574)
Subject: Re: FREE C++ development environments?
Date: Fri, 29 Jan 1993 01:39:56 GMT
Organization: Mentor Graphics Inc.
Keywords: 
Followup-To: 

SNIFF is available by anonymous FTP
Newsgroups: comp.lang.c++
From: kanze@us-es.sel.de (James Kanze)
Subject: Re: When Are Global Objects with a Constructor Initialized?
Organization: SEL
	<1993Jan25.174602.20429@taumet.com>
Date: 28 Jan 93 19:23:41

In article <1993Jan25.174602.20429@taumet.com> steve@taumet.com (Steve
Clamage) writes:

|> mbersohn@alchemy.chem.utoronto.ca (M. Bersohn) writes:

|> >	Does anyone know when global objects of a class with
|> >a constructor that does initializations are initialized,
|> >at compile time or at the beginning of execution?

|> Global objects with constructors are initialized before the first
|> statement of main() is executed.  Within one compilation unit, they
|> are initialized in definition order, except that objects with a
|> default initialization to zero are initialized first.  The C++
|> Committee is working on a way to specify that objects initialized with
|> constant expressions get initialized before other objects.  (Current
|> implementations usually work this way anyhow.)

This is not what it says in the ARM.  To quote (section 3.4):

	The initialization of nonlocal static objects in a translation
	unit is done before the first use of any function or object
	defined in that translation unit.  Such initializations may be
	done before the first statement of main(), or deferred to any
	point in time before the first use of a function or object
	defined in that translation unit.

I seem to recall reading that someone (I think it was HP) was actually
working on a C++ implementation in which this would be the case;
nonlocal static objects in a translation unit would only be
initialized immediately before the first use of a function or object
defined in that translation unit.  Further: if no function or object
in a translation unit is used during a run of the program, the static
objects in that translation unit would never be initialized.  (This
frequently occurs in interactive programs, where the user will only
use a small subset of the commands available in any one session.)
--
James Kanze                             email: kanze@us-es.sel.de
GABI Software, Sarl., 8 rue du Faisan, F-67000 Strasbourg, France
Conseils en informatique industrielle --
                   -- Beratung in industrieller Datenverarbeitung
From: davidm@consilium.com (David S. Masterson)
Newsgroups: comp.lang.c++
Subject: Re: Is this C++ advice from an OO book true?  (beginner question)
Date: 24 Jan 93 22:43:15 GMT
Distribution: comp
Organization: Consilium Inc., Mountain View, California
In-reply-to: sherman@unx.sas.com's message of 24 Jan 93 04:24:29 GMT
X-Posting-Software: GNUS 3.13  [ NNTP-based News Reader for GNU Emacs ]

>>>>> On 24 Jan 93 04:24:29 GMT, sherman@unx.sas.com (Chris Sherman) said:

> I read the following from a book that adviced how to do software projects
> using OO-type languages.  In one of the appendixes, it gave some advice
> on how to write C++ programs.  

> I don't understand one of the book's recommendations:

>   11.  Call virtual class constructors in derived class constructors.

I ran into this problem recently while designing an ostream class when I tried
to figure out how things worked.  The key words in the recommendation that are
causing you trouble are "virtual class".

In the case of a base class, derived classes need not worry about how their
immediate ancestors derive from other classes -- their base classes will take
care of that.  However, with "virtual" base classes, there is only one copy of
this base class in an object, so the question is which of the potentially many
classes that make up the object is responsible for instantiating that virtual
base class?  The answer is that, since there can only be a one for one
relationship between the object being instantiated and its class definition,
the class definition of the object must take responsibility for instantiating
the one copy of the virtual base class.  Therefore, every class that is
derived from a virtual base class must take responsibility for instantiating
that virtual base class (even if it doesn't, its equivalent to calling the
virtual base classes NULL constructor).
--
====================================================================
David Masterson					Consilium, Inc.
(415) 691-6311					640 Clyde Ct.
davidm@consilium.com				Mtn. View, CA  94043
====================================================================
I'm opposed to these unsupervised weekend furloughs for first-degree
murderers.
                -- George Bush, asked whether the Pledge of Allegiance
                   would be his only campaign issue in 1988.
Newsgroups: comp.lang.c++
From: gschwarz@dcc.uchile.cl (Guillermo Schwarz Utrup)
Subject: Virtual function call within constructors
Originator: gschwarz@trauco
Date: Sun, 24 Jan 1993 05:13:30 GMT
Organization: Universidad de Chile, Depto. de Ciencias de la Computacion


I have found that virtual functions are not handled as one could expect
when called from a constructor.

I proved the following code in SCO C++, Turbo C++ and G++:

-- cut here --
#include <stdio.h>

class Base
{
  public:
    Base();
    virtual void Vtl();
};

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

Base::Base()
{
   Vtl();  // this call should be virtual
}

void Base::Vtl()
{
   printf( "Base::Vtl()\n" );
}

Derived::Derived()
{
   Vtl();
}

void Derived::Vtl()
{
   printf( "Derived::Vtl()\n" );
}

main()
{
    Base b;
    Derived d;
}
-- cut here --

The object b constructor should call Base::Vtl(). It works.
The object D constructor calls object b constructor which in turn has
to call virtual method Vtl(), that is to say: Derived::Vtl(). It doesn't work.
Then object D constructor calls virtual method Vtl() directly, that is to
say: Derived::Vtl(). Of course, this part works.

The result should then be:
Base::Vtl()
Derived::Vtl()
Derived::Vtl()

But actually the output is:
Base::Vtl()
Base::Vtl()
Derived::Vtl() 

Well, it doesn't work as one would think. If the method is virtual,
why the constructor circumvents the correct way of calling?

I tried an equivalent code in Turbo Pascal 5.5:

program Virtual_Test;

type
    Base = object
              constructor Init;
              procedure Vtl; virtual;
            end;
    Derived = object
              constructor Init;
              procedure Vtl; virtual;
            end;

constructor Base.Init;
begin
      Vtl;
end;

procedure Base.Vtl;
begin
      writeln( "Base.Vtl" );
end;

constructor Derived.Init;
begin
      Base.Init;
      Vtl;
end;

procedure Derived.Vtl;
begin
      writeln( "Derived.Vtl" );
end;

var
    b :Base;
    d :Derived;

begin { main }
     b.Init;
     d.Init;
end.

Believe it or not this works as expected.
-- 
     _                           The difference between a shallow copy
 _  (_   _ |_        _    _ _    and a deep copy is that the first is
(_)  _) (_ | | \/\/ (_)\ |  _)   less happy than your mother.
  )                          )
Newsgroups: comp.lang.c++
From: pjl@cs.uiuc.edu (Paul Lucas)
Subject: Re: Friend ..Overload Assignment opertr ..
Organization: University of Illinois at Urbana-Champaign
Date: Fri, 22 Jan 1993 12:01:56 GMT

In <1993Jan22.075317.21062@usl.edu> rks9954@usl.edu (Srinivasa Rao K) writes:


> 


> Hi C++ masters,

>       I have small question ...

>       I am writing a "string"  class which i should be able
>       to use like


>       string str1;

>       str1 = "Hello world" ;



>       But We canot use a friend to overload the assignment oprator.

>      So finally  I had to convince myself to use something like


>       str1 <= "Hello world"


>       which works.

>      Is there any way to do the first method ....

	No.  operator=() must be a member.  Period.  Everybody defines it
	this way and has no problem.  Whats wrong with it being a member?
-- 
	- Paul J. Lucas
	  AT&T Bell Laboratories
	  Naperville, IL