Thanks for this link.
Following helper function was useful.
fn repeatStr(comptime s: []const u8, comptime n: usize) []const u8 {
const unit = @as([s.len]u8, s[0..s.len].*);
const str: [n * s.len]u8 = @bitCast(@as([n][s.len]u8, @splat(unit)));
return &str;
}
I could resolve this issue.
But it seems to need to add as the std lib, if ** operator is not reverted.
Edit:
Turns out there’s already an API for this, std.simd.repeat. Thanks for the pointer!