On 03/12/2013 06:17 PM, Alex Stewart wrote:
effectively multi-enum sets Speaking of sets... it seems like sets of single enum values would be a good way to represent "ORed-together enums". But then if you want a function to accept one, it has to be able to not care if it's only a single one or not.
So, what if each value of a 'flags' type enum is also able to be treated as a single-member set of itself? We already have one object that iterates into a sequence the same class: strings, so there's nothing wrong with that _conceptually_. The constructor could turn a sequence of the enum into a proper instance of it [if needed to get the int value] for passing into functions that require one, and a function that takes such a set of them could just not care the difference between Color.red|Color.blue and {Color.red,Color.blue}.