luluto
luluto

Reputation: 31

C++ Warning-- Identifier expected instead of "}"

I got this warning when I'm declaring one enum

enum Mask {
  NONE = 0,
  L = 1,
  H =2,
  U =4,
  V =8,
  D = 0X10,
  E = 0X20,
  P = 0X40,
  Q = 0X80,
};

typedef std::vector<Mask> MaskVec;

I think this warning comes from enum declaration. Could you please help me point out the problem?

Thanks

Upvotes: 3

Views: 2295

Answers (2)

David Ipsen
David Ipsen

Reputation: 1533

Try removing the comma after the last member of your enum.

Upvotes: 5

Tabrez Ahmed
Tabrez Ahmed

Reputation: 2950

Your code contained an extra comma.

enum Mask {
  NONE = 0,
  L = 1,
  H =2,
  U =4,
  V =8,
  D = 0X10,
  E = 0X20,
  P = 0X40,
  Q = 0X80 //You placed an extra comma here
};

Upvotes: 10

Related Questions