Open plut opened 3 years ago
You can just use view
instead, but we might want to allow this as well.
@plut @simeonschaub Can I try to solve this issue?
Sure, go ahead!
@simeonschaub I have made the necessary changes but could not find the tests file. Can you please help me? (The source file is base/refpointer.jl)
Sorry for not replying earlier. There is a file test/misc.jl
, which is probably not a bad place for these tests to go.
If
A
is a Matrix, I can (of course) access its elements by either linear or cartesian indices.However, constructing a reference to an entry of
A
is possible only by linear indexing:Returns MethodError: no method matching Ref(::Array{Int64,2}, ::Int64, ::Int64).
Wouldn't it make sense to extend
Ref
(there are only 4 methods total, 3 of them indexing by a singleInteger
) to have the same API asgetindex
?