From -3745240995172303159
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,11af4794c44339e8
X-Google-Attributes: gidf78e5,public
From: "Bill Wade" <bill.wade@stoner.com>
Subject: Re: Can you static_cast between enums?
Date: 1999/12/08
Message-ID: <82m0fj$2u3@library1.airnews.net>#1/1
X-Deja-AN: 558223523
X-NNTP-Posting-Host: !Xlmk1k-WC/u>nD (Encoded at Airnews!)
Approved: stephen.clamage@sun.com (comp.std.c++)
References: <ktA14.377$6A5.16841@dfiatx1-snr1.gtei.net> <384dc30d.21459442@news.csrlink.net>
X-UID: 0000000001
X-Status: $$$T
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Organization: Neosoft (using Airnews.net!)
Abuse-Reports-To: abuse at airmail.net to report improper postings
Newsgroups: comp.std.c++
Originator: clamage@taumet



John Potter wrote in message <384dc30d.21459442@news.csrlink.net>...
>On 07 Dec 99 15:51:47 GMT, Ron Burk <ronburk@gte.net> wrote:
>
>: Mark Wilson submitted this to our Bug++ column, and I'm
>: having trouble proving what's right from the standard. In
>: a nutshell, the question is: can static_cast cast between
>: different enums?  The sample code is:
>
>The answer is no.  Maybe someone will walk you through it, but
>here is an analogy of your logic.
>
>float f;
>int* pi = static_cast<int*>(&f);

A good point.  However 7.2/9 effectively says that there is some cast that
will do the conversion of one enum type to another.  Which cast works?  It
turns out that this is an open issue (#128) on the core language list.  So
the real answer is "maybe some day the committee will tell us."




[ 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://reality.sgi.com/austern_mti/std-c++/faq.html              ]




