Last active
August 29, 2015 14:01
-
-
Save asarium/efd998aebff3e90cc535 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Flagset*/ | |
template <class T, | |
typename size_type = typename std::underlying_type<T>::type, | |
size_type size = static_cast<size_type>(T::NUM_VALUES)> | |
class flagset { | |
SCP_bitset<size> values; | |
public: | |
bool& operator[](T idx) { return values[(static_cast<size_type>(idx)]; }; | |
const bool& operator[](T idx) { return values[static_cast<size_type>(idx)]; } const; | |
}; | |
#define FLAG_LIST(Type) enum class Type : size_t |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment