# \#zig-0-12

**URL:** https://ziggit.dev/tag/zig-0-12/53.md

[Latest](https://ziggit.dev/latest.md) · [Categories](https://ziggit.dev/categories.md) · [Tags](https://ziggit.dev/tags.md)

---

## [Captures and Payloads](https://ziggit.dev/t/captures-and-payloads/3125)

<div class="topic-metadata">

**Author:** [@AndrewCodeDev](https://ziggit.dev/u/AndrewCodeDev)\
**Replies:** 0\
**Last updated:** [February 4, 2024, 12:23am UTC](https://ziggit.dev/t/captures-and-payloads/3125 "2024-02-04T00:23:50Z")

</div>

Captures in Zig provide the ability to unpack or catch values as an extension of other language features. Capture syntax provide an elegant way to reduce boilerplate and clearly express intent with a minimal syntax. Dat…

---

## [Const pointer with large array size](https://ziggit.dev/t/const-pointer-with-large-array-size/4294)

<div class="topic-metadata">

**Author:** [@fmamud](https://ziggit.dev/u/fmamud)\
**Replies:** 9\
**Last updated:** [May 12, 2024, 8:27pm UTC](https://ziggit.dev/t/const-pointer-with-large-array-size/4294 "2024-05-12T20:27:11Z")

</div>

Hey, please could you help me to understand what is the expected behaviour of code snippet bellow? const t: \*const \[1000\]u8 = "asdf"; std.debug.print("string: {s}\\n", .{t}); I’m using a scaffold build file from zig ini…

---

## [Const, Var, and Comptime Compiler Optimizations](https://ziggit.dev/t/const-var-and-comptime-compiler-optimizations/3440)

<div class="topic-metadata">

**Author:** [@AndrewCodeDev](https://ziggit.dev/u/AndrewCodeDev)\
**Replies:** 6\
**Last updated:** [March 3, 2024, 2:38am UTC](https://ziggit.dev/t/const-var-and-comptime-compiler-optimizations/3440 "2024-03-03T02:38:17Z")

</div>

Overview The Zig compiler can use comptime-known information to produce optimized assembly code. These optimizations can involve (but are not limited to) removing read/store instructions and pre-calculating results. Exa…

---

## [Unintentional Copy On Capture](https://ziggit.dev/t/unintentional-copy-on-capture/3140)

<div class="topic-metadata">

**Author:** [@AndrewCodeDev](https://ziggit.dev/u/AndrewCodeDev)\
**Replies:** 15\
**Last updated:** [February 11, 2024, 3:18pm UTC](https://ziggit.dev/t/unintentional-copy-on-capture/3140 "2024-02-11T15:18:58Z")

</div>

Zig’s capture syntax can unpack objects by value or by pointer: for (slice) |elem| { // elem has been captured by value (copy) } for (slice) |\*elem| { // elem has been captured by pointer (reference) } Capturing…
