-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
proposal: isComptime builtin. #7539
Copy link
Copy link
Closed
Labels
proposalThis issue suggests language modifications. If it also has the "accepted" label then it is planned.This issue suggests language modifications. If it also has the "accepted" label then it is planned.
Milestone
Metadata
Metadata
Assignees
Labels
proposalThis issue suggests language modifications. If it also has the "accepted" label then it is planned.This issue suggests language modifications. If it also has the "accepted" label then it is planned.
currently (as far as I know), there is no simple to get whether a value is known at compile time. For integer types, you can do
@TypeOf(@clz(u8, val)) == comptime_int, but this is really more of a hack. Since this check already exists as part of@clz, it shouldn't be hard to implement into zig.