The OpenD Programming Language

rectangle

Convenience function to create a Rectangle!int or Rectangle!double.

  1. auto rectangle(T x, T y, T width, T height)
    rectangle
    (
    T
    )
    (
    T x
    ,
    T y
    ,,)
    if (
    isOneOf!(T, int, double)
    )
  2. auto rectangle(Point!T point, T width, T height)

Examples

auto a = rectangle(1, 1, 4, 4);
Rectangle!int rectInt = a;
auto b = rectangle(0.99, 0.99, 3.99, 3.99);
Rectangle!double rectDouble = b;

Meta