Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: EnumSet type #19470

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions base/Enums.jl
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,11 @@ Base.~{T<:FlagEnum}(x::T) = reinterpret(T, convert(Unsigned, typemax(T)) & ~conv
"""
@flagenum EnumName[::U] enumvalue1[=x] enumvalue1[=y]

Create an [`FlagEnum`](:obj:`FlagEnum`) type with name `EnumName` and base member values
of `enumvalue1` and `enumvalue1`, based on the unsigned integer type `U` (`UInt32` by
default). If the values `x` and `y` are provided, they must each have exactly a single bit
on, and naturally, not coincide. The `EnumName` type can be used just like other types,
and enum member values as regular values, such as
Create a `FlagEnum` type with name `EnumName` and base member values of `enumvalue1` and
`enumvalue1`, based on the unsigned integer type `U` (`UInt32` by default). If the values
`x` and `y` are provided, they must each have exactly a single bit on, and naturally, not
coincide. The `EnumName` type can be used just like other types, and enum member values as
regular values, such as

```jldoctest
julia> @flagenum FruitFlags apple=1<<0 orange=1<<1 kiwi=1<<2
Expand Down
1 change: 1 addition & 0 deletions doc/src/stdlib/base.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ Base.typejoin
Base.typeintersect
Base.Val
Base.Enums.@enum
Base.Enums.@flagenum
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not this PR's fault, but this seems like it's in kind of an odd section

Base.instances
```

Expand Down