Only if its initialization value is comptime
known will a const
local variable become a comptime
variable and thus end up having a static lifetime. I never rely on a local variable having a static lifetime unless I am working with an explicitly marked comptime
variable or something else that is explicitly comptime
-known like a type
valued variable or a string literal.
2 Likes