From -6345244225437437969
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fc772,f84c8cecfc4d5b7f
X-Google-Attributes: gidfc772,public
X-Google-Thread: f78e5,a4f3c15d97de4122
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2002-07-13 19:02:07 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!paloalto-snf1.gtei.net!denver-snf1.gtei.net!news.gtei.net!namche.sun.com!sunnews1.Eng.Sun.COM!engnews1.eng.sun.com!taumet!clamage
From: Allan_W@my-dejanews.com (Allan W)
Newsgroups: comp.std.c++,comp.lang.c++.moderated
Subject: Re: Why don't constructors and destructors have return types?
Date: 14 Jul 2002 01:51:10 GMT
Organization: http://groups.google.com/
Lines: 41
Approved: stephen.clamage@sun.com (comp.std.c++)
Message-ID: <23b84d65.0207121402.452015f@posting.google.com>
References: <3D1FB54B.FFDC9969@bawi.org>
  <3d209e70.1346875@news.earthlink.net>
  <VcmwzfCb6YI9EwOi@robinton.demon.co.uk>
  <3d21c520.27573671@news.earthlink.net>
  <nhu5iuocqmnu3jf3h2k65ic17euk894v9j@4ax.com>
  <3d24ccd3.20691953@news.earthlink.net>
  <7uvaiug6ionjvtmhp8lks5k8s9qvdo12i5@4ax.com>
  <3d25e7c0.34024125@news.earthlink.net>
  <qn6oiuojq5ogmdegpvt3jt5bl85sd4erbc@4ax.com>
  <3d2c4170.15685078@207.217.77.25>
  <k4eriugdf99ibvvljv86t8f367iv89n4ln@4ax.com>
NNTP-Posting-Host: taumet.eng.sun.com
X-NNTP-Posting-Host: netlab.cs.rpi.edu
X-Original-Date: 12 Jul 2002 15:02:26 -0700
X-Submission-Address: c++-submit@netlab.cs.rpi.edu
X-Auth: PGPMoose V1.1 PGP comp.lang.c++.moderated
	iQBVAwUAPTAbOEHMCo9UcraBAQEjAgH+LIhJSEY4BXfr4wjeO5+0NL0Lz/VGoSXQ
	wm9wGRBQilLZrWqjGKXa/spDnFCZ7oYwnAXU73PysI/aWyro++stKA==
	=rubA
X-Approved-For-Group: francis.moderator@robinton.demon.co.uk comp.lang.c++.moderated
X-Scanned-By: MIMEDefang 2.3 (www dot roaringpenguin dot com slash mimedefang)
X-MailScanner: Passed
Content-Length: 1485
Originator: clamage@taumet
Xref: archiver1.google.com comp.std.c++:12689 comp.lang.c++.moderated:46516


Gennaro Prota <gennaro_prota@yahoo.com> wrote
 > b) Changing 5.3.3p1 to explicitly state that sizeof considers
 > exclusively "complete objects"
 >
 > "The sizeof operator yields the number of bytes in the object
 > representation of [its operand -> *a complete object* whose type is
 > determined by its operand]."

This might be feasible for objects that already have type_info.
But it's a fundamental change, and shouldn't be taken lightly.

     class base { char x[4]; };
     void foo(base *b) {
         std::cout << sizeof(base) << "-" << sizeof(*b);
     }

     class der : public base { char y[2]; };
     int main() {
         Base b; foo(&b); std::cout << ", ";
         Der  d; foo(&d); std::cout << std::endl;
     }

What does this print? Under current rules, it prints "4-4, 4-4" unless
alignment concerns make base bigger than 4 bytes. Under new rules
it could be "4-4, 4-6" or "4-4, 4-8". Furthermore, sizeof() can no
longer be performed at runtime except in constrained situation, such as
   sizeof(base)
in the code above.



      [ Send an empty e-mail to c++-help@netlab.cs.rpi.edu for info ]
      [ about comp.lang.c++.moderated. First time posters: do this! ]

[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]




