Skip to content

Commit 7d5735e

Browse files
authored
conditional definition of _pointer methods (for Julia 1.6) (#17)
* conditional definition of _pointer methods (for Julia 1.6) * updates for new versions of Julia and StaticArrays * test on Julia 1.5 * 1.5 is not on available in CI yet + version bump
1 parent 19dd719 commit 7d5735e

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
name = "HybridArrays"
22
uuid = "1baab800-613f-4b0a-84e4-9cd3431bfbb9"
33
authors = ["Mateusz Baran <mateuszbaran89@gmail.com>"]
4-
version = "0.3.5"
4+
version = "0.3.6"
55

66
[deps]
77
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
88
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
99

1010
[compat]
11-
StaticArrays = "=0.12.3"
11+
StaticArrays = "=0.12.4"
1212
julia = "1"
1313

1414
[extras]

src/ssubarray.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,10 @@ Base.unsafe_convert(::Type{Ptr{T}}, V::SSubArray{T,N,P,<:Tuple{Vararg{Base.Range
262262
Base.pointer(V::FastSSubArray, i::Int) = pointer(V.parent, V.offset1 + V.stride1*i)
263263
Base.pointer(V::FastContiguousSSubArray, i::Int) = pointer(V.parent, V.offset1 + i)
264264
Base.pointer(V::SSubArray, i::Int) = Base._pointer(V, i)
265-
Base._pointer(V::SSubArray{<:Any,1}, i::Int) = pointer(V, (i,))
266-
Base._pointer(V::SSubArray, i::Int) = pointer(V, Base._ind2sub(axes(V), i))
265+
if isdefined(Base, :_pointer)
266+
Base._pointer(V::SSubArray{<:Any,1}, i::Int) = pointer(V, (i,))
267+
Base._pointer(V::SSubArray, i::Int) = pointer(V, Base._ind2sub(axes(V), i))
268+
end
267269

268270
function Base.pointer(V::SSubArray{T,N,<:Array,<:Tuple{Vararg{Base.RangeIndex}}}, is::Tuple{Vararg{Int}}) where {T,N}
269271
index = Base.first_index(V)

0 commit comments

Comments
 (0)