I have heard some people say that the singleton “pattern” doesn't simply mean there is on instance; it means there are a fixed number of instances, each distinct from all others. Even
Wikipedia mentions this:-
The concept is sometimes generalized to systems that operate more efficiently when only one object exists, or that restrict the instantiation to a certain number of objects.
If you enhance the concept of singletons to include classes with fixed numbers of distinct instances, isn't that what an
enum is? Every
enum ever seen matches that description.