From -2530666485319262665
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fc772,8d9af67f0c48e4ef
X-Google-Attributes: gidfc772,public
X-Google-Thread: f78e5,8d9af67f0c48e4ef
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2002-05-02 15:12:08 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!cpk-news-hub1.bbnplanet.com!denver-snf1.gtei.net!news.gtei.net!namche.sun.com!news2me.EBay.Sun.COM!engnews1.eng.sun.com!taumet!clamage
From: "James Kuyper Jr." <kuyper@wizard.net>
Newsgroups: comp.std.c++,comp.lang.c++.moderated
Subject: Re: Unsignedness of size_t
Date: 2 May 2002 22:01:50 GMT
Organization: Not enough
Lines: 34
Approved: stephen.clamage@sun.com (comp.std.c++)
Message-ID: <3CD085BB.FFCA33F8@wizard.net>
References: <3CC7DB8F.52E75D62@bawi.org>
 <1020129034.890475@cswreg.cos.agilent.com>
NNTP-Posting-Host: taumet.eng.sun.com
X-NNTP-Posting-Host: netlab.cs.rpi.edu
X-Original-Date: Thu, 02 May 2002 00:04:48 GMT
X-Submission-Address: c++-submit@netlab.cs.rpi.edu
X-Auth: PGPMoose V1.1 PGP comp.lang.c++.moderated
	iQBVAwUAPNG2AkHMCo9UcraBAQFutQIAlxYaFuoUNGmc2tbfNEiQKZx1PYS/JOD8
	PFJuaSKGfqGAlq4s9zbs5du1EPVBH1HsL/Tc4VKuqEy72f3oEy5rcw==
	=JUL8
X-Approved-For-Group: jep@[151.161.11.6] comp.lang.c++.moderated
X-Scanned-By: MIMEDefang 2.3 (www dot roaringpenguin dot com slash mimedefang)
Content-Length: 1490
X-Status: $$$T
X-UID: 0000000001
Originator: clamage@taumet
Xref: archiver1.google.com comp.std.c++:11000 comp.lang.c++.moderated:42544


Geoff Field wrote:
> 
> "Sungbom Kim" <musiphil@bawi.org> wrote in message
> news:3CC7DB8F.52E75D62@bawi.org...
> > I often find it somewhat "flawed" that the standard requires the data
> > type representing sizes of objects to be an unsigned integral type.
> >
> > They are just arithmetic quantities, like 'number of people'; no one
> > would recommend using unsigned numbers for those kind of quantities.
> 
> Why not?  Can one have *negative* numbers of people, or negative sizes?
> To my mind, unsigned integral types are the most natural model of a
> count of anything "real" - be it people, bytes or bits.

You can negative values for the difference in between two different
numbers of people, or in the difference of two sizes. And, thanks to the
use of size_t, those negative values won't actually come out negative
unless you pay careful attention. Sure, you should always pay careful
attention; but it's bad design to create a system where there are,
unnecessarily, too many different things one has to pay attention to at
the same time.



      [ 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                       ]




