Skip to content

Commit

Permalink
Add deprecated ind2sub(::NTuple{N,Integer}, ::CartesianIndex{N}) (#…
Browse files Browse the repository at this point in the history
…23708)

Makes the return type change of #22907 less breaking by allowing the
common pattern `ind2sub(size(a), indmax(a))` to still work.
  • Loading branch information
martinholters authored and mbauman committed Sep 22, 2017
1 parent b752b87 commit 942b843
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1822,6 +1822,10 @@ import .Iterators.enumerate
return p
end

# ease transition for return type change of e.g. indmax due to PR #22907 when used in the
# common pattern `ind2sub(size(a), indmax(a))`
@deprecate(ind2sub(dims::NTuple{N,Integer}, idx::CartesianIndex{N}) where N, Tuple(idx))

@deprecate contains(eq::Function, itr, x) any(y->eq(y,x), itr)

# PR #23690
Expand Down

0 comments on commit 942b843

Please sign in to comment.