Print-Zig-Test/p.zig

6 lines
196 B
Zig
Raw Normal View History

2024-01-26 23:10:32 +00:00
pub fn print(s: anytype) void {
const ur = [2]type{comptime_int, comptime_float};
@import("std").debug.
print(if (@TypeOf(s) == ur[if (@TypeOf(s) == ur[0]) 0 else 1]) "{}" else "{s}", .{s});
}