This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Specifying the underlying enum type in g++
- From: Gabriel Dos Reis <dosreis at gmail dot com>
- To: Jean-Claude Gervais <jc dot gervais at videotron dot ca>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 24 Sep 2009 15:41:06 -0500
- Subject: Re: Specifying the underlying enum type in g++
- References: <1253805080.8262.334.camel@localhost>
- Reply-to: gdr at integrable-solutions dot net
On Thu, Sep 24, 2009 at 10:11 AM, Jean-Claude Gervais
<jc.gervais@videotron.ca> wrote:
> Hello,
>
> I am using gcc 4.1.2 and 4.3.2, looking for a way to specify the
> underlying type in a typedef enum declaration like so:
>
> typedef enum : unsigned char { first_tag, second_tag, third_tag }
> my_enum_type;
There is a C++0x extension to do that, but you would have to get
newer versions of g++.
>
> The preceding statement compiles with visualc++ but not with g++
>
> Is there a way?
>
> Thanks
> J
>
>