We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
static_length
UnitRange
1 parent d68b119 commit f44c82bCopy full SHA for f44c82b
src/static.jl
@@ -127,6 +127,7 @@ end
127
return StaticInt(L)
128
end
129
130
+@inline static_length(a::UnitRange{T}) where {T} = last(a) - first(a) + oneunit(T)
131
@inline static_length(x) = maybe_static(known_length, length, x)
132
@inline static_first(x) = maybe_static(known_first, first, x)
133
@inline static_last(x) = maybe_static(known_last, last, x)
0 commit comments