News for hackers. Stuff that matters.
Re:Why Zig When There Is Already CPP, D, and Rust? (2017) by mborch on Monday October 15, 2018 @02:38AM (#18217834)
What it does have is compile-time parameters where you can bind a type variable during compilation:

  fn max(comptime T: type, a: T, b: T) T {
      if (T == bool) {
          return a or b;
      } else if (a > b) {
          return a;
      } else {
          return b;
      }
  }
The type variable isn't used at run-time.

There are no comments on this comment yet.