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>
This commit is contained in:
Jason Ho 2022-08-31 20:53:00 -05:00 committed by GitHub
parent 7a733b9385
commit 2b92c5a23e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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>