#pragma once #include namespace bits { template inline void Set(_Ty &old, _Ty flag) { static_assert(std::is_arithmetic<_Ty>::value, "_Ty must be an arithmetic type"); old |= flag; } template inline void Unset(_Ty &old, _Ty flag) { static_assert(std::is_arithmetic<_Ty>::value, "_Ty must be an arithmetic type"); old &= ~flag; } template inline bool Has(_Ty old, _Ty flag) { static_assert(std::is_arithmetic<_Ty>::value, "_Ty must be an arithmetic type"); return !!(old & flag); } }