isCustomSerializable

Checks if a given type has a custom serialization representation.

A class or struct type is custom serializable if it defines a pair of toRepresentation/fromRepresentation methods. Any class or struct type that has this trait will be serialized by using the return value of it's toRepresentation method instead of the original value.

This trait has precedence over isISOExtStringSerializable and isStringSerializable.

template isCustomSerializable (
T
) {}

Members

Variables

isCustomSerializable
enum bool isCustomSerializable;
Undocumented in source.

Examples

// represented as a single uint when serialized
static struct S {
	ushort x, y;

	uint toRepresentation() const { return x + (y << 16); }
	static S fromRepresentation(uint i) { return S(i & 0xFFFF, i >> 16); }
}

static assert(isCustomSerializable!S);

Meta