Skip to content

Enum class objects need to inherit from instance type. #43

@bobjervis

Description

@bobjervis

When an enum defines class methods, etc. there is an anomaly where you cannot determine the value of the enum from the value of this. Also, you can only convert (without a cast) this to address type. The value of *this is unuable (it is the class value, which cannot be the value of any other expression).

If, however, the enum class type inherits from the instance type and we store the instance value in the base clas, then *this can convert to the base class (i.e. the instance type), which makes intuitive sense.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions