help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Enumeration Issue


From: Paulo Matos
Subject: Enumeration Issue
Date: 30 Oct 2006 11:32:52 -0800
User-agent: G2/1.0

Hello all,


Guess I have an enumeration:
enum xpto {one, two, three};

How can I compute the number of elements in this enumeration?
I could in this specific case do:
enum xpto {one, two, three, NUMELEMENTS};

and each time I add an element I add it _before_ NUMELEMENTS, still
being this a constant during runtime (don't think there's a way to ad
an element during runtime) there could be a compiler specific way to do
this, right? Is there any?

Regards,

Paulo Matos



reply via email to

[Prev in Thread] Current Thread [Next in Thread]