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,174ec7dc941a1068 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!cyclone1.gnilink.net!spamkiller.gnilink.net!gnilink.net!trnddc08.POSTED!7c706d3b!not-for-mail From: David Thompson Newsgroups: comp.lang.ada Subject: Re: Factory Pattern Organization: Poor Message-ID: <1l10c39bd7ghcvk8lij3hvr0lhevc2mahp@4ax.com> References: <1185387571.367570.163160@r34g2000hsd.googlegroups.com> <1185432247.046242.24300@o61g2000hsh.googlegroups.com> <1185540454.137500.28610@b79g2000hse.googlegroups.com> X-Newsreader: Forte Agent 3.3/32.846 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Sun, 26 Aug 2007 07:18:07 GMT NNTP-Posting-Host: 70.17.44.207 X-Complaints-To: abuse@verizon.net X-Trace: trnddc08 1188112687 70.17.44.207 (Sun, 26 Aug 2007 03:18:07 EDT) NNTP-Posting-Date: Sun, 26 Aug 2007 03:18:07 EDT Xref: g2news2.google.com comp.lang.ada:1563 X-Original-Bytes: 2431 Date: 2007-08-26T07:18:07+00:00 List-Id: On Fri, 27 Jul 2007 05:47:34 -0700, Maciej Sobczak wrote: > On 27 Lip, 12:16, "Jeffrey R. Carter" > wrote: > > > > No. C and C++ have enumerations. > > > > Which are just names for integer values, last time I looked. > > No. There are implicit conversions to int, but enums are separate > types. > > > The type of > > a function parameter would be int. > > No. Each enum is a separate type: > Actually this is an area of difference between C and C++, and as such called out in Annex C of the C++ standard. In C enum values are just 'int' values, and enum types are just aliases for integer types -- commonly just one integer type, 'int', although the C standard did and does allow each enum type to be any integer type that covers the specified range. You can directly assign (or pass or return) to an enum from an integer or different enum type. In C++, each enum type is a distinct type, and its values are of its type; as you go on to detail, they can disambiguate overloads, and also an enum can be silently converted to integer (int or possibly long, since C++ unlike C allows enum values outside the range of int), but not to another enum or from integer to enum without a cast or in some (stronger) contexts a user-defined conversion operator. - formerly david.thompson1 || achar(64) || worldnet.att.net