Skip to content

Instantly share code, notes, and snippets.

@DaviRain-Su
Last active September 21, 2025 03:58
Show Gist options
  • Select an option

  • Save DaviRain-Su/6cf80b8ddd1260d4f482043560f13375 to your computer and use it in GitHub Desktop.

Select an option

Save DaviRain-Su/6cf80b8ddd1260d4f482043560f13375 to your computer and use it in GitHub Desktop.
About compare zig with rust

Compare Zig With Rust

泛型方法对比

fn add<T>(a: T, b: T) -> T
where
    T: std::ops::Add<Output = T>,
{
    a + b
}
fn Add(comptime T: type, a: T, b: T) T {
    return a + b;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment