#include <type_traits>
#include <bitset>
#include <iostream>

template< typename >
struct enum_traits;

// Lots of components
enum class components {
	comp_01, comp_02, comp_03, comp_04, comp_05, comp_06, comp_07, comp_08, comp_09, comp_10,
	comp_11, comp_12, comp_13, comp_14, comp_15, comp_16, comp_17, comp_18, comp_19, comp_20,
	comp_21, comp_22, comp_23, comp_24, comp_25, comp_26, comp_27, comp_28, comp_29, comp_30,
	comp_31, comp_32, comp_33, comp_34, comp_35, comp_36, comp_37, comp_38, comp_39, comp_40,
	comp_41, comp_42, comp_43, comp_44, comp_45, comp_46, comp_47, comp_48, comp_49, comp_50,
	comp_51, comp_52, comp_53, comp_54, comp_55, comp_56, comp_57, comp_58, comp_59, comp_60,
	comp_61, comp_62, comp_63, comp_64, comp_65, comp_66, comp_67, comp_68, comp_69, comp_70,
	count // size of enumeration
};

template<>
struct enum_traits< components > {
	static constexpr bool bit_index = true;
};

template< typename t >
struct flag_bits : std::bitset< static_cast< int >(t::count) > {
	flag_bits(t bit) // implicit
		{ this->set( static_cast< int >( bit ) ); }

	flag_bits(typename flag_bits::bitset set)
		: flag_bits::bitset(set) {}
};

template< typename e >
typename std::enable_if< enum_traits< e >::bit_index,
	flag_bits< e > >::type
	operator | (flag_bits< e > set, e next)
{
		return set | flag_bits< e >(next);
}

template< typename e >
typename std::enable_if< enum_traits< e >::bit_index,
	flag_bits< e > >::type
	operator | (e first, e next)
{
		return flag_bits< e >(first) | next;
}

int main() {
	std::cout << (components::comp_01 | components::comp_50) << '\n';
}