File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 11name = " Static"
22uuid = " aedffcd0-7271-4cad-89d0-dc628f76c6d3"
33authors = [" chriselrod" , " ChrisRackauckas" , " Tokazama" ]
4- version = " 0.7"
4+ version = " 0.7.1 "
55
66[deps ]
77IfElse = " 615f187c-cbe4-4ef1-ba3b-2fcf58d6d173"
Original file line number Diff line number Diff line change @@ -481,8 +481,19 @@ Base.:(^)(x::Integer, y::True) = x
481481Base.:(^ )(x:: BigInt , y:: False ) = one (x)
482482Base.:(^ )(x:: BigInt , y:: True ) = x
483483
484+ @inline function Base. ntuple (f:: F , :: StaticInt{N} ) where {F,N}
485+ (N >= 0 ) || throw (ArgumentError (string (" tuple length should be ≥ 0, got " , N)))
486+ if @generated
487+ quote
488+ Base. Cartesian. @ntuple $ N i -> f (i)
489+ end
490+ else
491+ Tuple (f (i) for i = 1 : N)
492+ end
493+ end
494+
484495@inline function invariant_permutation (@nospecialize (x:: Tuple ), @nospecialize (y:: Tuple ))
485- if y === x === nstatic ( Val (nfields (x)))
496+ if y === x === ntuple (static, StaticInt (nfields (x)))
486497 return True ()
487498 else
488499 return False ()
You can’t perform that action at this time.
0 commit comments