Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #8122

Re: enum escaping keywords

From "James" <no@spam.invalid>
Newsgroups comp.lang.c++
Subject Re: enum escaping keywords
Date 2011-07-22 16:37 -0700
Organization Aioe.org NNTP Server
Message-ID <j0d1ig$4f4$1@speranza.aioe.org> (permalink)
References <j0c9t4$e8p$1@online.de>

Show all headers | View raw


"Philipp Kraus" <philipp.kraus@flashpixx.de> wrote in message 
news:j0c9t4$e8p$1@online.de...
> Hello,
>
> I create a enum type with language codes like:
> enum lang {
> en,
> it,
> de,
> asm,
> or
> }
>
> but some codes are keywords (asm, or). How can I escape them, so that I 
> can use them like
> lang::or or lang::asm ?


struct lang {
    enum instruction {
        EN,
        IT,
        DE,
        ASM,
        OR
    };
};


? 

Back to comp.lang.c++ | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

enum escaping keywords Philipp Kraus <philipp.kraus@flashpixx.de> - 2011-07-22 18:52 +0200
  Re: enum escaping keywords "Balog Pal" <pasa@lib.hu> - 2011-07-22 19:19 +0200
    Re: enum escaping keywords Philipp Kraus <philipp.kraus@flashpixx.de> - 2011-07-22 19:35 +0200
      Re: enum escaping keywords Victor Bazarov <v.bazarov@comcast.invalid> - 2011-07-22 13:52 -0400
  Re: enum escaping keywords James Kanze <james.kanze@gmail.com> - 2011-07-22 13:02 -0700
  Re: enum escaping keywords "James" <no@spam.invalid> - 2011-07-22 16:37 -0700

csiph-web