isStaticNeighbourhood

Tests if something is a StaticNeighbourhood.

returns true if T is a StaticNeighbourhood of dimension N.

A StaticNeighbourhood is a $(NEIGHBOURHOOD) that never changes. If a particular cell has a particular neighbour it will always have that neighbour. Also, if a cell where to have a neighbour "to the right" all other cells will also have a neighbour "to the right". A StaticNeighbourhood dosen't really add any additional functionality. All it does is having the a uint enum NeighboursAmount.

template isStaticNeighbourhood (
T
uint N
) {}

Members

Aliases

Coord
alias Coord = Repeat!(N, int)
Undocumented in source.

Manifest constants

isStaticNeighbourhood
enum isStaticNeighbourhood;
Undocumented in source.

Parameters

T

type to be tested

N

number of dimensions

Return Value

true if T is a StaticNeighbourhood, false if not

Examples

struct A {
	enum uint Dimension = 2;
	enum uint NeighboursAmount = 1;
	enum isStatic;
	int[2][] getNeighboursCoordinates(int x, int y) {
		return [[x+1, y+1]];
	}
}

static assert( isNeighbourhood!(A, 2));
static assert( isStaticNeighbourhood!(A, 2));
static assert(!isStaticNeighbourhood!(string, 1));

Meta