US

Undocumented in source.
version(unittest)
@safe static
struct US {}

Postblit

this(this)
this(this)
Undocumented in source.

Members

Functions

f
void f()
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

x
int x;
Undocumented in source.

Examples

auto a = [1, 2, 3].staticArray;
static assert(is(typeof(a) == int[a.length]));
static assert(is(typeof([1, 2, 3].staticArray) == int[a.length]));

auto b = "hello".s;
static assert(is(typeof(b) == char[5]));

auto x = s!ubyte(1, 2, 3);
static assert(is(typeof(x) == ubyte[3]));

non-copyable element type in static array

auto b = [US(42)].s;
static assert(b.length == 1);
auto x = [1, 2, 3].staticArray;

static assert(is(typeof(x) == int[x.length]));
static assert(is(typeof([1, 2, 3].staticArray) == int[x.length]));

static assert(!__traits(compiles, {
	static int[] doNotDoThat() {
		return [1, 2, 3].s;
	}
}));

Meta