typedef enum

Q

qazmlp

Any comments on this construct ?

class testClass
{
public:
typedef enum
{
SOME_CONS0 = 0,
SOME_CONS1,
SOME_CONS2
} Type;
} ;
 
R

Rolf Magnus

qazmlp said:
Any comments on this construct ?

What exactly is your poblem with it?
class testClass
{
public:
typedef enum

The typedef doesn't hurt here, but it's not needed.
{
SOME_CONS0 = 0,
SOME_CONS1,
SOME_CONS2

I usually don't use identifiers in all uppercase for enums and rather
reserve them for preprocessor macros. I think that's a good idea, since
that turns preporcessor marco names into kind of a red flag. You lose
that if you use all uppercase names for anything else.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top