Crell / enum-comparison

A comparison of enumerations and similar features in different languages
82 stars 7 forks source link

Add value() method #42

Closed Crell closed 3 years ago

Crell commented 3 years ago

For scalar-backed enums, add a value() method that returns the corresponding value.

For unit enums, the method doesn't exist and so will error out like any other missing method. Possibly with a more targeted error message.

Crell commented 3 years ago

RFC has been updated accordingly. @iluuu1994, mark this closed when it's been implemented.