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

clarify documentation for @view #39542

Merged
merged 3 commits into from
Feb 10, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions base/views.jl
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ end
@view A[inds...]

Creates a `SubArray` from an indexing expression. This can only be applied directly to a
simeonschaub marked this conversation as resolved.
Show resolved Hide resolved
reference expression (e.g. `@view A[1,2:end]`), and should *not* be used as the target of
an assignment (e.g. `@view(A[1,2:end]) = ...`). See also [`@views`](@ref)
reference expression (e.g. `@view A[1, 2:end]`). It should *not* be used as the target of
a regular assignment (e.g. `@view(A[1, 2:end]) = ...`), although it can still be useful for
broadcasted assignment (e.g. `@view(A[1, 2:end] .*= 2`). See also [`@views`](@ref)
simeonschaub marked this conversation as resolved.
Show resolved Hide resolved
to switch an entire block of code to use views for slicing.

!!! compat "Julia 1.5"
Expand Down