authorgravatar for jasonho353@gmail.comJason Ho <jasonho353@gmail.com> 2022-08-31 20:53:00-05:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2022-08-31 21:53:00-04:00
log2b92c5a23e912df56885ff10d690ff7bfd1e3f47
tree9151f5152df9d05c407707993a087a982144a8d2
parent7a733b9385e77bc6b9aa1c62ca180a6ba9f14f3f
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

langref: tweak description of `[]T` (#12319)

saying []T is a pointer is confusing because zig docs say there are two types of pointers (*T and [*]T). It is more clear to say that []T is a slice type which contains a [*]T pointer and a length. Co-authored-by: Philipp Lühmann <47984692+luehmann@users.noreply.github.com>

1 files changed, 1 insertions(+), 1 deletions(-)

doc/langref.html.in+1-1
......@@ -2631,7 +2631,7 @@ test "Conversion between vectors, arrays, and slices" {
26312631 </li>
26322632 </ul>
26332633 <ul>
2634 <li>{#syntax#}[]T{#endsyntax#} - pointer to runtime-known number of items.
2634 <li>{#syntax#}[]T{#endsyntax#} - is a slice (a fat pointer, which contains a pointer of type {#syntax#}[*]T{#endsyntax#} and a length).
26352635 <ul>
26362636 <li>Supports index syntax: {#syntax#}slice[i]{#endsyntax#}</li>
26372637 <li>Supports slice syntax: {#syntax#}slice[start..end]{#endsyntax#}</li>