Top "Enumeration" questions

The process of enumerating values, for example from some collection.

Which Typesafe Enum in C++ Are You Using?

It is common knowledge that built-in enums in C++ are not typesafe. I was wondering which classes implementing typesafe enums …

design-patterns enums enumeration type-safety c++03
Enumerate over an enum in C++

In C++, Is it possible to enumerate over an enum (either runtime or compile time (preferred)) and call functions/generate …

c++ enums metaprogramming enumeration
What is the best way to handle constants in Ruby when using Rails?

I have some constants that represent the valid options in one of my model's fields. What's the best way to …

ruby-on-rails ruby constants enumeration
XSD: How to restrict enumeration values of a derived complex type?

Given the following example: <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:complexType name="Book" …

xsd enumeration restriction
Singular or plural for enumerations?

Do you use singular or plural for enumerations? I think it makes best sense with plural in the declaration enum …

coding-style enumeration
How to define enum in as3?

Is there a way to define an enum in AS3 in a way we do it in other languages? I …

actionscript-3 enumeration
Possibility of mapping enum values to string type instead of integer

Enum attributes are great and I want to use them. But mapping enum values to integer would make it hard …

ruby-on-rails ruby-on-rails-4 enumeration
Elixir - Looping through and adding to map

I'm rebuilding something in Elixir from some code I built in C#. It was pretty hacked together, but works perfectly (…

enumeration elixir
How to use std::foreach with parameters/modification

I've found myself writing for(int i=0;i<myvec.size();i++) myvec[i]->DoWhatever(param); a lot, …

c++ stl loops enumeration
How to convert string result of enum with overridden toString() back to enum?

Given the following java enum: public enum AgeRange { A18TO23 { public String toString() { return "18 - 23"; } }, A24TO29 { public String toString() { …

java enums enumeration converter