Skip to content

Commit

Permalink
Merge pull request #4261 from wilzbach/ndslice_document_ptr
Browse files Browse the repository at this point in the history
[ndslice]: doc fix follow-up
  • Loading branch information
9il committed Apr 29, 2016
2 parents 85f9e81 + e3f35b9 commit 6f6f61c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions std/experimental/ndslice/slice.d
Original file line number Diff line number Diff line change
Expand Up @@ -1180,13 +1180,16 @@ struct Slice(size_t _N, _Range)

/++
Returns:
pointer to the first element of a slice if slice is defined as `Slice!(N, T*)` or
plain structure with two fields `shift` and `range` otherwise. In second case the expression `range[shift]`
refers to the first element. For slices with named elements the type of a return value has the same behavior like a pointer.
Pointer to the first element of a slice if slice is defined as `Slice!(N, T*)`
or plain structure with two fields `shift` and `range` otherwise.
In second case the expression `range[shift]` refers to the first element.
For slices with named elements the type of a return value
has the same behavior like a pointer.
Note:
`ptr` is defined only for not packed slices.
`ptr` is defined only for non-packed slices.
Attention:
`ptr` refers to the first element in the memory representation if and only if all strides are positive.
`ptr` refers to the first element in the memory representation
if and only if all strides are positive.
+/
static if (is(PureRange == Range))
auto ptr() @property
Expand Down

0 comments on commit 6f6f61c

Please sign in to comment.