Compare commits
No commits in common. "lesson_61" and "master" have entirely different histories.
|
@ -1,30 +0,0 @@
|
||||||
/*
|
|
||||||
* main.cpp
|
|
||||||
*
|
|
||||||
* Created on: 11 сент. 2021 г.
|
|
||||||
* Author: alexander
|
|
||||||
*/
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
enum class Race
|
|
||||||
{
|
|
||||||
OGRE,
|
|
||||||
GOBLIN,
|
|
||||||
SKELETON,
|
|
||||||
ORC,
|
|
||||||
TROLL,
|
|
||||||
};
|
|
||||||
|
|
||||||
Race Rexxar(Race::OGRE);
|
|
||||||
|
|
||||||
using std::cout;
|
|
||||||
using std::endl;
|
|
||||||
|
|
||||||
// Необходимо явное преобразование, т.к. перечисление
|
|
||||||
// является классом, имеет локальную область видимости
|
|
||||||
cout << static_cast<int>(Rexxar) << endl;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
Loading…
Reference in New Issue