#What exactly does it mean to have a pointer to a `comptime` object?

1 messages · Page 1 of 1 (latest)

sacred raft
#
const std = @import("std");

test {
    const foo = comptime [_]u8{ 1, 2, 3, };
    std.debug.print("\n{*}\n", .{ &foo }); // ???
}
candid cliff
#

well, as it pertains to the type system, that's still just a *const [3]u8, same as if it were a runtime "object" that you got a constant pointer to.

#

so, in terms of semantics, there isn't much distinction, you're just not allowed to write through it