Skip to content

Instantly share code, notes, and snippets.

@terurou
Created April 2, 2018 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save terurou/c9cf1fc3527b72f50375bad53331e6f8 to your computer and use it in GitHub Desktop.
Save terurou/c9cf1fc3527b72f50375bad53331e6f8 to your computer and use it in GitHub Desktop.
Haxe Tuple2
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