Skip to content

Nesting FieldFlags Types #13

Open
Open
@mrufsvold

Description

@mrufsvold

It would be helpful if fields of a @bitfields struct could be type annotated with types generated by FlagFields so that you could nest types for cleaner code organization without losing the tight packing.

For example:

@bitflags mutable struct BasicNeeds
       hungry
       tired
       injured
end

@bitfields mutable struct Health
    basic_needs::BasicNeeds
    disease_status:2
ebd

struct Person
    health::Health
end

person.health.basic_needs.hungry = true

Could be considered once #9 is implemented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions