comp.lang.ada
 help / color / mirror / Atom feed
From: ddavenpo@redwood.hac.com (Darren C Davenport)
Subject: Re: on OO differnces between Ada95 and C++
Date: 1996/02/26
Date: 1996-02-26T00:00:00+00:00	[thread overview]
Message-ID: <4gspen$ot0@hacgate2.hac.com> (raw)
In-Reply-To: 4gi413$qo1@druid.borland.com

Pete Becker (pete@borland.com) wrote:
: In article <3129F185.41C6@Rational.COM>, jDesquilbet@Rational.COM says...
: >
: >- you may have several different definitions for the same class in the
: >same program, as long as they are never compiled together in the same
: >compilation unit; example:
: >
: >#define private public // *** BERK! ***
: >#include "...h"        // second definition for the same class
: >#undef private

: This is not true. A program that attempts to do this violates the one 
: definition rule, so it is not a legal C++ program.
: 	-- Pete

We need to be careful here with terms used to describe C++ constructs.  
A class name declaration is a C++ declaration (ARM C++ 3.1) not a definition.
This is what is specified in ".h" files.  There can be multiple declarations
so the above code is legal C++ code.  There can only be one definition
of each object, function, class, and enumerator in a program and these
are specified in ".cc" files.  Mr. Becker is correct about stating that
there must be only one definition but that rule does not apply in this
instance.

Darren Davenport





  parent reply	other threads:[~1996-02-26  0:00 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-02-20  0:00 on OO differnces between Ada95 and C++ Nasser Abbasi
1996-02-20  0:00 ` Norman H. Cohen
1996-02-21  0:00   ` Mark A Biggar
1996-02-22  0:00     ` Norman H. Cohen
1996-02-27  0:00   ` Adam Morris
1996-02-20  0:00 ` Jerome Desquilbet
1996-02-21  0:00   ` Robert Dewar
1996-02-22  0:00     ` Jerome Desquilbet
1996-02-24  0:00       ` Robert Dewar
1996-02-22  0:00   ` Pete Becker
1996-02-23  0:00     ` Jerome Desquilbet
1996-02-26  0:00     ` Darren C Davenport [this message]
1996-02-26  0:00       ` Pete Becker
1996-02-27  0:00         ` Nigel Perry
1996-02-20  0:00 ` Robert I. Eachus
1996-02-21  0:00 ` Darren C Davenport
1996-02-21  0:00 ` Jon S Anthony
1996-02-21  0:00 ` John English
1996-02-22  0:00   ` Nasser Abbasi
1996-02-26  0:00     ` John English
1996-02-27  0:00       ` Dale Stanbrough
1996-02-22  0:00   ` Gene Ouye
1996-02-26  0:00     ` John English
  -- strict thread matches above, loose matches on Subject: below --
1996-02-21  0:00 Christian Jaensch, FRG
1996-02-26  0:00 Simon Johnston
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox