≈ the.bay.news

Slice type coercion

Ziggit
Slice type coercion
I’m confused with the type coercion around the slice type. Here are examples: coerce a slice to a many-item pointer. What’s the intention to give up the length property here? E.g., const tag_name = @tagName(TestEnum.TestEnumValue); const ptr_tag_name: [*:0]const u8 = tag_name; // test/behavior/string_literals.zig file in Zig codebase comptime slice. Isn’t it runtime-known of the length for a slice? What’s actually a comptime slice? test "comptime slice" { const test_string: []const u8...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.