🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #2836

Re: Can I declare private constants?

#2836
From: Ulf Schuenemann
Date: Mon, 04 Dec 1995 22:16
46 lines
2700 bytes
A propos One-Definition-Rule (ODR): My _April_ version of the 
DWP confuses me. 3.2 [basic.def.odr]:
1:	No translation unit shall contain more then one definition ...
6:	There can be more than one definition 
	of a named enumeration type in a program ...
7:	There can be more than one definition 
	of a class type in a program ...

a) I can't find the prohibition of definitions of the same entity
   in multiple different translation units
   as long as there is only one per translation unit.
   (Indepentent weather the definitions are identical or not.)
b) Multiple defintions of enumerations and classes are explicitly 
   allowed but where are "extern inline function" ?
c) Maybe Multiple defintions of "extern const objects" are also
   explicitly allowed somewhere, and I just didn't find it? ;-)

[ Note 3.5 [basic.link] talks about external linkage:
  8:	Two names ... shall denote the same object, function, 
	type, enumerator or template ...
  but not about multiple definitions for the same entity (eg class).
]

Either my index.ps is missing some important links 
or THE ODR IS BORKEN.

If it should show that we have to add
8:	There can be more than one definition 
	of a extern inline function in a program ...
to 3.2 [basic.def.odr] then couldn't we also add
9:	There can be more than one definition 
	of a extern const object in a program ...
?	

Ulf Schuenemann

--------------------------------------------------------------------
 ,_.   Ulf Schuenemann
#,  \  Fakultaet fuer Informatik, Technische Universitaet Muenchen, Germany.
 |   > email: schuenem@informatik.tu-muenchen.de
 v=-<  WWW:   http://hphalle2.informatik.tu-muenchen.de/~schuenem/

[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID: <49v11u$atj@sunsystem5.informatik.tu-muenchen.de>
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamage
References: <49kge5$imb@sunsystem5.informatik.tu-muenchen.de> <49lcij$i7h@engnews1.eng.sun.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamage
From: schuenem@informatik.tu-muenchen.de (Ulf Schuenemann)
Newsgroups: comp.std.c++
Subject: Re: Can I declare private constants?
Date: 4 Dec 1995 22:16:17 GMT
Organization: Technische Universitaet Muenchen, Germany
Sender: USENET Newssystem <news@informatik.tu-muenchen.de>
Approved: clamage@eng.sun.com (comp.std.c++)
Message-ID: <49v11u$atj@sunsystem5.informatik.tu-muenchen.de>
References: <49kge5$imb@sunsystem5.informatik.tu-muenchen.de> <49lcij$i7h@engnews1.eng.sun.com>
NNTP-Posting-Host: taumet.eng.sun.com
Content-Type: text
X-Nntp-Posting-Host: hpbroy14.informatik.tu-muenchen.de
Originator: schuenem@hpbroy14.informatik.tu-muenchen.de
Content-Length: 1668
X-Lines: 42
Originator: clamage@taumet