52 template<
class Enum,
int nEnum>
58 StaticAssert(nEnum > 0);
74 static const char*
names[nEnum];
word name(const complex &)
Return a string representation of a complex.
const Enum operator[](const char *name) const
Return the enumeration element corresponding to the given name.
An STL-conforming hash table.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
A class for handling words, derived from string.
static stringList strings()
The set of names as a list of strings.
const double e
Elementary charge.
static wordList words()
The set of names as a list of words.
NamedEnum()
Construct from names.
Initialise the NamedEnum HashTable from the static list of names.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Enum read(Istream &) const
Read a word from Istream and return the corresponding.
void write(const Enum e, Ostream &) const
Write the name representation of the enumeration to an Ostream.