-
-
Save fengb/e6af2dc55fbc7cc783bef562162ac106 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn Pair(comptime T0: type, comptime T1: type) type { | |
return @TypeOf(.{ @as(T0, undefined), @as(T1, undefined) }); | |
} | |
fn add(p: Pair(i32, i32)) i32 { | |
return p[0] + p[1]; | |
} | |
test "" { | |
_ = add; | |
} |
Author
fengb
commented
Jan 28, 2020
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment