Created
April 2, 2018 14:23
-
-
Save terurou/c9cf1fc3527b72f50375bad53331e6f8 to your computer and use it in GitHub Desktop.
Haxe Tuple2
This file contains hidden or 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
abstract Tuple2<T1, T2>(Array<Dynamic>) { | |
public var value1(get, never): T1; | |
public var value2(get, never): T2; | |
public inline function new(a: T1, b: T2) { | |
this = [a, b]; | |
} | |
inline function get_value1(): T1 { | |
return this[0]; | |
} | |
inline function get_value2(): T2 { | |
return this[1]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment