Is there any convenient CopyMemory function in Phobos?

bearophile bearophileHUGS at lycos.com
Mon Jun 13 17:53:36 PDT 2011


Andrej Mitrovic:

> Right, haven't thought about the C functions at all (silly me).
> Thanks, this did the trick:
> extern (C) void* memcpy(void*, const void*, size_t);

Maybe you are able to wrap that memcpy in a templated D function (named copyMemory) that does what you want in a bit safer way, that contains some static and runtime asserts, etc.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list