sclass DoublePt is IDoublePt { double x, y; *() {} *(Point p) { x = p.x; y = p.y; } *(double *x, double *y) {} equals DoublePt p { ret x == p.x && y == p.y; } public int hashCode() { ret boostHashCombine(main hashCode(x), main hashCode(y)); } toString { ret x + ", " + y; } double length() { ret sqrt(x*x+y*y); } public double x_double() { ret x; } public double y_double() { ret y; } }