From 4950468211337500644
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-04-30 16:35:09 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!paloalto-snf1.gtei.net!crtntx1-snh1.gtei.net!denver-snf1.gtei.net!news.gtei.net!namche.sun.com!news2me.EBay.Sun.COM!engnews1.eng.sun.com!taumet!clamage
From: Francis Glassborow <francis.glassborow@ntlworld.com>
Newsgroups: comp.std.c++,comp.lang.c++.moderated
Subject: Re: Unsignedness of size_t
Date: 30 Apr 2002 23:26:31 GMT
Organization: Southfield Microcomputer SS
Lines: 31
Approved: stephen.clamage@sun.com (comp.std.c++)
Message-ID: <t26KU6Avhtz8EwnZ@robinton.demon.co.uk>
References: <3CC7DB8F.52E75D62@bawi.org>
 <RPfz8.11$Vo2.244@paloalto-snr1.gtei.net>
Reply-To: Francis Glassborow <francisG@robinton.demon.co.uk>
NNTP-Posting-Host: taumet.eng.sun.com
X-NNTP-Posting-Host: netlab.cs.rpi.edu
X-Original-Date: Tue, 30 Apr 2002 18:46:23 +0100
X-Submission-Address: c++-submit@netlab.cs.rpi.edu
X-Auth: PGPMoose V1.1 PGP comp.lang.c++.moderated
	iQBVAwUAPM8mXEHMCo9UcraBAQEMiwIArsLA/SEqW2FFWMqQ+HKZwwFxHT02tnII
	jQXz2KwWfJw/gg2kPfymqvGLg2r4xpGLu7LBw/XaHC1cbkpDj34qYA==
	=ztsB
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: 1262
X-Status: $$$$
X-UID: 0000000001
Originator: clamage@taumet
Xref: archiver1.google.com comp.std.c++:10929 comp.lang.c++.moderated:42419


In article <RPfz8.11$Vo2.244@paloalto-snr1.gtei.net>, Barry Margolin 
<barmar@genuity.net> writes
>Why not?  You can't have objects with negative size, just as you can't have
>a class in school with a negative number of students.  Unsigned types are
>appropriate for variables that can only hold non-negative values.

I would argue (on odd days of the month) that it only makes sense to 
have an unsigned type if underflow raises an exception.

The real trouble with unsigned is that programmers have to very careful 
that they do not mix unsigned with signed. Mostly mixtures work because 
unsigned is a modular type, but now and again it causes a disaster.

-- 
Francis Glassborow      ACCU
64 Southfield Rd
Oxford OX4 1PA          +44(0)1865 246490
All opinions are mine and do not represent those of any organisation



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




