From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,2cb1f0b6d642e1dc X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!w7g2000yqe.googlegroups.com!not-for-mail From: Phil Clayton Newsgroups: comp.lang.ada Subject: Re: Pascal Calling Convention Date: Thu, 31 Mar 2011 00:40:54 -0700 (PDT) Organization: http://groups.google.com Message-ID: <29dd260d-474e-4b33-b460-180ad4facab1@w7g2000yqe.googlegroups.com> References: <9b04626e-567d-408c-aab3-39b964b3ffd6@l2g2000prg.googlegroups.com> <4d90efdd$1$14806$882e7ee2@usenet-news.net> <330393be-cb82-4cd8-ba44-6e59af7b75bf@v11g2000prb.googlegroups.com> <4d90fd41$1$14782$882e7ee2@usenet-news.net> <4d911e17$0$6776$9b4e6d93@newsspool3.arcor-online.net> NNTP-Posting-Host: 94.169.109.47 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1301557254 19997 127.0.0.1 (31 Mar 2011 07:40:54 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 31 Mar 2011 07:40:54 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: w7g2000yqe.googlegroups.com; posting-host=94.169.109.47; posting-account=v7gx3AoAAABfjb9m5b7l_Lt2KVEgQBIe User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (SymbianOS/9.4; U; Series60/5.0 Nokia5800d-1/30.0.011; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:19590 Date: 2011-03-31T00:40:54-07:00 List-Id: On Mar 30, 2:42=A0pm, Phil Clayton wrote: > On Mar 29, 1:23 pm, stefan-lu...@see-the.signature wrote: > > > > > The original C++ from Hyman Rosen was > > > template > > class set > > { > > =A0 =A0 unsigned n; =A0 =A0// number of members in set > > =A0 =A0 unsigned d[N]; // members are in d[0..n-1] > > =A0 =A0 unsigned s[N]; // d[s[k]] =3D=3D k if k is a member > > =A0 =A0 // unspecified elements of d and s are arbitrary > > > public: > > =A0 =A0 set() : n(0) { } > > =A0 =A0 bool has(unsigned k) > > =A0 =A0 =A0 =A0 { return k < N && s[k] < n && d[s[k]] =3D=3D k; } > > =A0 =A0 void add(unsigned k) > > =A0 =A0 =A0 =A0 { if (k < N && !has(k)) { d[n] =3D k; s[k] =3D n++; } > > =A0 =A0 void del(unsigned k) > > =A0 =A0 =A0 =A0 { if (has(k)) { unsigned i =3D s[k]; d[i] =3D d[--n]; s= [d[i]] =3D i; } > > =A0 =A0 void clr() { n =3D 0; } > > > }; > > Interesting. =A0It's worth noting that if N is equal to the number of > keys representable by unsigned Except that it can't be because N is also of type unsigned so there can't be 'overflow' either. I didn't see that in the template argument. Ignore me. Phil