Код: Выделить всё
#include
enum item_type {
a,
b
};
class item {
public:
item_type type;
item(item_type type) : type{type} {}
};
int main() {
item a{a};
item b{b};
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79036663/enum-in-c-not-working-as-expected-instead-is-initalized-with-first-value[/url]