c++: enum inside of a class using “enum class”
问题 What would be the right way to write an enum inside a class? I am writing conway's game of life code in c++. So i have a patterns class which contains the info about different kind of patterns: class Patterns { public: Patterns(); ~Patterns(void); private: enum class PatternType { bloat, block, blinker, toad }; PatternType pattern_; }; My goal is not to pollute the global space here. So is it the write way of writing the enum inside of a class keeping oops concepts in mind. If not, please