Unpacker.scan

Scans an entire buffer and converts each objects.

This method is used for unpacking record-like objects.

struct Unpacker
int
scan
(
Types...
)
(
scope int delegate
(
ref Types
)
dg
)

Examples

// serialized data is "[1, 2][3, 4][5, 6][...".
auto unpacker = Unpacker(serializedData);
foreach (n, d; &unpacker.scan!(int, int))  // == "foreach (int n, int d; unpacker)"
    writeln(n, d); // 1st loop "1, 2", 2nd loop "3, 4"...

Meta