import mem fun greater(a: T, b: T): T { if (a > b) return a; return b; } fun lesser(a: T, b: T): T { if (a > b) return b; return a; } fun make_pair(first: T, second: U): pair { var it.construct(first, second): pair return it } obj pair(Object) { var first: T var second: U fun construct(firstIn: T, secondIn: U): pair* { mem::maybe_copy_construct(&first, &firstIn) mem::maybe_copy_construct(&second, &secondIn) return this } fun construct(): pair* { mem::maybe_construct(&first) mem::maybe_construct(&second) return this } fun copy_construct(old: pair*):void { mem::maybe_copy_construct(&first, &old->first) mem::maybe_copy_construct(&second, &old->second) } fun destruct():void { mem::maybe_destruct(&first) mem::maybe_destruct(&second) } }