枚举类

1
2
3
4
5
6
7
8
9
10
11
12
13
//不同枚举类中枚举常量值有相同的名字不会发生冲突,普通枚举类型会冲突
#include<iostream>
using namespace std;
enum class Side(Right,Left);
enum class Thing(Wrong,Right);
int main()
{

    Side s=Side::Right;
    Thing w=Thing::Right;
    cout<<(s==w)<<endl;
    return 0;
}