Commit 2b92c5a23e

Jason Ho <jasonho353@gmail.com>
2022-09-01 03:53:00
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 parent 7a733b9
Changed files (1)
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>