isSideArray

Side array is a static array defining a property separately for each side of a box, for example margin and border size. Order is as follows: [left, right, top, bottom]. You can use Style.Side to index this array with an enum.

Because of the default behavior of static arrays, one can set the value for all sides to be equal with a simple assignment: array = 8. Additionally, to make it easier to manipulate the box, one may use the sideX and sideY functions to get a uint[2] array of the values corresponding to the given axis (which can also be assigned like array.sideX = 8) or the sideLeft, sideRight, sideTop and sideBottom functions corresponding to the given sides.

@safe
enum isSideArray (
T
)

Examples

uint[4] sides;
static assert(isSideArray!(uint[4]));

sides.sideX = 4;

assert(sides.sideLeft == sides.sideRight);
assert(sides.sideLeft == 4);

sides = 8;
assert(sides == [8, 8, 8, 8]);
assert(sides.sideX == sides.sideY);

Meta