Skip to content

Commit

Permalink
Update src/BitStringAddresses/occupationnumberfs.jl
Browse files Browse the repository at this point in the history
Co-authored-by: jamie-tay <[email protected]>
  • Loading branch information
joachimbrand and jamie-tay authored Feb 5, 2025
1 parent c0a2e51 commit da90474
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/BitStringAddresses/occupationnumberfs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ OccupationNumberFS(arg::Integer) = OccupationNumberFS{1}(arg) # to resolve ambig

function OccupationNumberFS{M}(args...) where M
sv = SVector{M}(args...)
if all(x -> isa(x, Pair), sv)
return OccupationNumberFS{M}(Tuple(sv))
end
all(isinteger, sv) || throw(ArgumentError("all arguments must be integers"))
all(x -> x 0, sv) || throw(ArgumentError("all arguments must be non-negative"))
all(x -> x < 256, sv) || throw(ArgumentError("arguments don't fit in a byte, specify type"))
Expand Down

0 comments on commit da90474

Please sign in to comment.