DataBuffer.this

Initialize with buf to use as scratch buffer space.

struct DataBuffer(T, alias realloc = core.stdc.stdlib.realloc)
this
(
T[] buf
)
if (
isAssignable!T &&
!hasElaborateDestructor!T
&&
!hasElaborateCopyConstructor!T
&&
!hasElaborateAssign!T
)

Parameters

buf T[]

Scratch buffer space, must have length that is even

Examples

ubyte[10] tmpbuf = void;
auto sbuf = DataBuffer!ubyte(tmpbuf);

If buf was created by the same realloc passed as a parameter to DataBuffer, then the contents of DataBuffer can be extracted without needing to copy them, and DataBuffer.free() will not need to be called.

Meta