Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add get method that accepts CartesianIndex (# 30259) #30268

Merged
merged 1 commit into from
Dec 5, 2018

Conversation

jw3126
Copy link
Contributor

@jw3126 jw3126 commented Dec 4, 2018

fix #30259

@@ -89,6 +89,7 @@ module IteratorsMD

# indexing
getindex(index::CartesianIndex, i::Integer) = index.I[i]
Base.get(A::AbstractArray, I::CartesianIndex, default) = get(A, I.I, default)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably not the ideal place for this definition. Not sure, where it should go instead.

Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think it's ok. Ideally it'd go near the rest of the get methods, but that won't work due to bootstrapping since they live in abstractarray.jl.

Copy link
Sponsor Member

@mbauman mbauman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

get and CartesianIndex
4 participants