#include <iomanip>
#include <iostream>
#include <type_traits>
using namespace std;

enum struct XXX : int {
	AAA = 123,
	BBB = 456,
};

int main() {
	cout << "Is XXX self-assignable: "
		 << boolalpha << is_assignable<XXX, XXX>::value
		 << endl;
		 
	auto x = XXX::AAA;
	x = XXX::BBB;

	cout << "... but why is x == "
		 << static_cast<underlying_type_t<XXX>>(x)
		 << endl;

	return 0;
}
