Template Enumap.opDispatch

Access the value at the index specified by the name of an enum member.

The value is returned by reference, so it can used for assignment. map.name is just syntactic sugar for map[SomeEnum.name].

Arguments

template opDispatch(string s);

Functions

Function name Description
opDispatch

Example

Enumap!(Element, int) elements;
elements.water = 5;
assert(elements.water == 5);

Authors

Ryan Roden-Corrent (rcorre)

Copyright

© 2015, Ryan Roden-Corrent

License

MIT