From 5858392026853675705
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,8d9af67f0c48e4ef
X-Google-Attributes: gidf78e5,public
X-Google-Thread: fc772,8d9af67f0c48e4ef
X-Google-Attributes: gidfc772,public
X-Google-ArrivalTime: 2002-05-01 15:02:13 PST
Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!supernews.com!newsfeed.ision.net!ision!nautilus.eusc.inter.net!newsfeed.hanau.net!news-fra1.dfn.de!news-han1.dfn.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!cpk-news-hub1.bbnplanet.com!denver-snf1.gtei.net!news.gtei.net!namche.sun.com!sunnews1.Eng.Sun.COM!engnews1.eng.sun.com!taumet!clamage
From: jpotter@falcon.lhup.edu (John Potter)
Newsgroups: comp.std.c++,comp.lang.c++.moderated
Subject: Re: Unsignedness of size_t
Date: 1 May 2002 21:57:05 GMT
Organization: EarthLink Inc. -- http://www.EarthLink.net
Lines: 31
Approved: stephen.clamage@sun.com (comp.std.c++)
Message-ID: <3cceea67.4384033@news.earthlink.net>
References: <3CC7DB8F.52E75D62@bawi.org>
 <3ccd96e9.5974430@news.ch.kpnqwest.net>
Reply-To: jpotter@penguin.lhup.edu
NNTP-Posting-Host: taumet.eng.sun.com
X-NNTP-Posting-Host: netlab.cs.rpi.edu
X-Original-Date: Tue, 30 Apr 2002 19:09:19 GMT
X-Submission-Address: c++-submit@netlab.cs.rpi.edu
X-Auth: PGPMoose V1.1 PGP comp.lang.c++.moderated
	iQBVAwUAPNBcFEHMCo9UcraBAQGK2gH/RB9JRvtd+0CKAIqypUG75JrahjgXEgzD
	phTl3opc/oFySn0h1ft0KWpvNFiAm3v/BHH/0R8Bw47FteHzHXERRQ==
	=CVQg
X-Approved-For-Group: harkness@procountinc.com comp.lang.c++.moderated
X-Scanned-By: MIMEDefang 2.3 (www dot roaringpenguin dot com slash mimedefang)
Content-Length: 899
X-Status: $$$T
X-UID: 0000000001
Originator: clamage@taumet
Xref: archiver1.google.com comp.std.c++:10963 comp.lang.c++.moderated:42477


On 29 Apr 2002 22:41:31 GMT, rhairgroveNoSpam@Pleasebigfoot.com (Bob
Hairgrove) wrote:

> As to arithmetic, can you give an example where it would be wise (or
> even necessary) to mix signed and unsigned values?

Neither wise nor necessary, but common.
   vector<C> v;
   ...
   for (int x = 0; x != v.size(); ++ x)
I'm sure that you always write
   for (vector<C>::size_type u = 0; u != v.size(); ++ u)
and
   v.begin() + x
but never
   v.begin() + u

John



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




