aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJason Ho <jasonho353@gmail.com>2022-08-31 20:53:00 -0500
committerGitHub <noreply@github.com>2022-08-31 21:53:00 -0400
commit2b92c5a23e912df56885ff10d690ff7bfd1e3f47 (patch)
tree9151f5152df9d05c407707993a087a982144a8d2 /doc
parent7a733b9385e77bc6b9aa1c62ca180a6ba9f14f3f (diff)
downloadzig-2b92c5a23e912df56885ff10d690ff7bfd1e3f47.tar.gz
zig-2b92c5a23e912df56885ff10d690ff7bfd1e3f47.zip
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>
Diffstat (limited to 'doc')
-rw-r--r--doc/langref.html.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/doc/langref.html.in b/doc/langref.html.in
index 0d10119cb7..162ba44700 100644
--- a/doc/langref.html.in
+++ b/doc/langref.html.in
@@ -2631,7 +2631,7 @@ test "Conversion between vectors, arrays, and slices" {
</li>
</ul>
<ul>
- <li>{#syntax#}[]T{#endsyntax#} - pointer to runtime-known number of items.
+ <li>{#syntax#}[]T{#endsyntax#} - is a slice (a fat pointer, which contains a pointer of type {#syntax#}[*]T{#endsyntax#} and a length).
<ul>
<li>Supports index syntax: {#syntax#}slice[i]{#endsyntax#}</li>
<li>Supports slice syntax: {#syntax#}slice[start..end]{#endsyntax#}</li>